This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[sfrench/samba-autobuild/.git] / docs / docbook / projdoc / Portability.sgml
1 <chapter id="Portability">
2 <chapterinfo>
3         <author>
4                 <firstname>Jelmer</firstname><surname>Vernooij</surname>
5         </author>
6 </chapterinfo>
7
8 <title>Portability</title>
9
10 <para>Samba works on a wide range of platforms but the interface all the 
11 platforms provide is not always compatible. This chapter contains 
12 platform-specific information about compiling and using samba.</para>
13
14 <sect1>
15 <title>HPUX</title>
16
17 <para>
18 HP's implementation of supplementary groups is, er, non-standard (for
19 hysterical reasons).  There are two group files, /etc/group and
20 /etc/logingroup; the system maps UIDs to numbers using the former, but
21 initgroups() reads the latter.  Most system admins who know the ropes
22 symlink /etc/group to /etc/logingroup (hard link doesn't work for reasons
23 too stupid to go into here).  initgroups() will complain if one of the
24 groups you're in in /etc/logingroup has what it considers to be an invalid
25 ID, which means outside the range [0..UID_MAX], where UID_MAX is (I think)
26 60000 currently on HP-UX.  This precludes -2 and 65534, the usual 'nobody'
27 GIDs.
28 </para>
29
30 <para>
31 If you encounter this problem, make sure that the programs that are failing 
32 to initgroups() be run as users not in any groups with GIDs outside the 
33 allowed range.
34 </para>
35
36 <para>This is documented in the HP manual pages under setgroups(2) and passwd(4).
37 </para>
38
39 </sect1>
40
41 <sect1>
42 <title>SCO Unix</title>
43
44 <para> 
45 If you run an old version of  SCO Unix then you may need to get important 
46 TCP/IP patches for Samba to work correctly. Without the patch, you may 
47 encounter corrupt data transfers using samba.
48 </para>
49
50 <para>
51 The patch you need is UOD385 Connection Drivers SLS. It is available from
52 SCO (ftp.sco.com, directory SLS, files uod385a.Z and uod385a.ltr.Z).
53 </para>
54
55 </sect1>
56
57 <sect1>
58 <title>DNIX</title>
59
60 <para>
61 DNIX has a problem with seteuid() and setegid(). These routines are
62 needed for Samba to work correctly, but they were left out of the DNIX
63 C library for some reason.
64 </para>
65
66 <para>
67 For this reason Samba by default defines the macro NO_EID in the DNIX
68 section of includes.h. This works around the problem in a limited way,
69 but it is far from ideal, some things still won't work right.
70 </para>
71
72 <para> 
73 To fix the problem properly you need to assemble the following two
74 functions and then either add them to your C library or link them into
75 Samba.
76 </para>
77
78 <para> 
79 put this in the file <filename>setegid.s</filename>:
80 </para>
81
82 <para><programlisting>
83         .globl  _setegid
84 _setegid:
85         moveq   #47,d0
86         movl    #100,a0
87         moveq   #1,d1
88         movl    4(sp),a1
89         trap    #9
90         bccs    1$
91         jmp     cerror
92 1$:
93         clrl    d0
94         rts
95 </programlisting></para>
96
97 <para>
98 put this in the file <filename>seteuid.s</filename>:
99 </para>
100
101 <para><programlisting>
102         .globl  _seteuid
103 _seteuid:
104         moveq   #47,d0
105         movl    #100,a0
106         moveq   #0,d1
107         movl    4(sp),a1
108         trap    #9
109         bccs    1$
110         jmp     cerror
111 1$:
112         clrl    d0
113         rts
114 </programlisting></para>
115
116 <para>
117 after creating the above files you then assemble them using
118 </para>
119
120 <para><command>as seteuid.s</command></para>
121 <para><command>as setegid.s</command></para>
122
123 <para>
124 that should produce the files <filename>seteuid.o</filename> and 
125 <filename>setegid.o</filename>
126 </para>
127
128 <para>
129 then you need to add these to the LIBSM line in the DNIX section of
130 the Samba Makefile. Your LIBSM line will then look something like this:
131 </para>
132
133 <para><programlisting>
134 LIBSM = setegid.o seteuid.o -ln
135 </programlisting></para>
136
137 <para> 
138 You should then remove the line:
139 </para>
140
141 <para><programlisting>
142 #define NO_EID
143 </programlisting></para>
144
145 <para>from the DNIX section of <filename>includes.h</filename></para>
146
147 </sect1>
148 </chapter>