Initial version imported to CVS
[ira/wip.git] / docs / textdocs / DNIX.txt
1 DNIX has a problem with seteuid() and setegid(). These routines are
2 needed for Samba to work correctly, but they were left out of the DNIX
3 C library for some reason.
4
5 For this reason Samba by default defines the macro NO_EID in the DNIX
6 section of includes.h. This works around the problem in a limited way,
7 but it is far from ideal, some things still won't work right.
8
9 To fix the problem properly you need to assemble the following two
10 functions and then either add them to your C library or link them into
11 Samba.
12
13 put this in the file setegid.s:
14
15         .globl  _setegid
16 _setegid:
17         moveq   #47,d0
18         movl    #100,a0
19         moveq   #1,d1
20         movl    4(sp),a1
21         trap    #9
22         bccs    1$
23         jmp     cerror
24 1$:
25         clrl    d0
26         rts
27
28
29 put this in the file seteuid.s:
30
31         .globl  _seteuid
32 _seteuid:
33         moveq   #47,d0
34         movl    #100,a0
35         moveq   #0,d1
36         movl    4(sp),a1
37         trap    #9
38         bccs    1$
39         jmp     cerror
40 1$:
41         clrl    d0
42         rts
43
44 after creating the above files you then assemble them using
45
46 as seteuid.s
47 as setegid.s
48
49 that should produce the files seteuid.o and setegid.o
50
51 then you need to add these to the LIBSM line in the DNIX section of
52 the Samba Makefile. Your LIBSM line will then look something like this:
53
54 LIBSM = setegid.o seteuid.o -ln
55
56 You should then remove the line:
57
58 #define NO_EID
59
60 from the DNIX section of includes.h
61
62 Then recompile and try it out!
63
64 Note that this file was derived from an email from Peter Olsson
65 <pol@leissner.se>. I don't have DNIX myself, so you're probably better
66 off contacting Peter if you have problems.
67
68 Andrew
69