summaryrefslogtreecommitdiff
path: root/docs/textdocs/DNIX.txt
blob: 4c1fcbde31a374beae01729f5b9be8dc9ea1ac04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
!==
!== DNIX.txt for Samba release 2.1.0prealpha 981204
!==
DNIX has a problem with seteuid() and setegid(). These routines are
needed for Samba to work correctly, but they were left out of the DNIX
C library for some reason.

For this reason Samba by default defines the macro NO_EID in the DNIX
section of includes.h. This works around the problem in a limited way,
but it is far from ideal, some things still won't work right.

To fix the problem properly you need to assemble the following two
functions and then either add them to your C library or link them into
Samba.

put this in the file setegid.s:

        .globl  _setegid
_setegid:
        moveq   #47,d0
        movl    #100,a0
        moveq   #1,d1
        movl    4(sp),a1
        trap    #9
        bccs    1$
        jmp     cerror
1$:
        clrl    d0
        rts


put this in the file seteuid.s:

        .globl  _seteuid
_seteuid:
        moveq   #47,d0
        movl    #100,a0
        moveq   #0,d1
        movl    4(sp),a1
        trap    #9
        bccs    1$
        jmp     cerror
1$:
        clrl    d0
        rts

after creating the above files you then assemble them using

as seteuid.s
as setegid.s

that should produce the files seteuid.o and setegid.o

then you need to add these to the LIBSM line in the DNIX section of
the Samba Makefile. Your LIBSM line will then look something like this:

LIBSM = setegid.o seteuid.o -ln

You should then remove the line:

#define NO_EID

from the DNIX section of includes.h

Then recompile and try it out!

Note that this file was derived from an email from Peter Olsson
<pol@leissner.se>. I don't have DNIX myself, so you're probably better
off contacting Peter if you have problems.

Andrew