Relocate name lookup info to correct section.
[Samba.git] / docs / Samba-HOWTO-Collection / Portability.xml
bloba4f7107e41ad1f5ddae8341bd12e3dacf4baa824
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3                 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4   <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
5   %global_entities;
6 ]>
7 <chapter id="Portability">
8 <chapterinfo>
9         &author.jelmer;
10         &author.jht;
11         <!-- Some other people as well, but there were no author names in the text files this file is based on-->
12 </chapterinfo>
14 <title>Portability</title>
16 <para>Samba works on a wide range of platforms but the interface all the 
17 platforms provide is not always compatible. This chapter contains 
18 platform-specific information about compiling and using Samba.</para>
20 <sect1>
21 <title>HPUX</title>
23 <para>
24 HP's implementation of supplementary groups is non-standard (for
25 historical reasons). There are two group files, <filename>/etc/group</filename> and
26 <filename>/etc/logingroup</filename>; the system maps UIDs to numbers using the former, but
27 initgroups() reads the latter. Most system Admins who know the ropes
28 symlink <filename>/etc/group</filename> to <filename>/etc/logingroup</filename>
29 (hard link does not work for reasons too obtuse to go into here). initgroups() will complain if one of the
30 groups you're in in <filename>/etc/logingroup</filename> has what it considers to be an invalid
31 ID, which means outside the range <constant>[0..UID_MAX]</constant>, where <constant>UID_MAX</constant> is (I think)
32 60000 currently on HP-UX. This precludes -2 and 65534, the usual <constant>nobody</constant>
33 GIDs.
34 </para>
36 <para>
37 If you encounter this problem, make sure the programs that are failing 
38 to initgroups() are run as users, not in any groups with GIDs outside the 
39 allowed range.
40 </para>
42 <para>This is documented in the HP manual pages under setgroups(2) and passwd(4).
43 </para>
45 <para>
46 On HP-UX you must use gcc or the HP ANSI compiler. The free compiler
47 that comes with HP-UX is not ANSI compliant and cannot compile Samba.
48 </para>
50 </sect1>
52 <sect1>
53 <title>SCO UNIX</title>
55 <para> 
56 If you run an old version of SCO UNIX, you may need to get important 
57 TCP/IP patches for Samba to work correctly. Without the patch, you may 
58 encounter corrupt data transfers using Samba.
59 </para>
61 <para>
62 The patch you need is UOD385 Connection Drivers SLS. It is available from
63 SCO (<ulink noescape="1" url="ftp://ftp.sco.com/">ftp.sco.com</ulink>, directory SLS,
64 files uod385a.Z and uod385a.ltr.Z).
65 </para>
67 <para>
68 The information provided here refers to an old version of SCO UNIX. If you require
69 binaries for more recent SCO UNIX products, please contact SCO to obtain packages that are
70 ready to install. You should also verify with SCO that your platform is up-to-date for the
71 binary packages you will install. This is important if you wish to avoid data corruption
72 problems with your installation. To build Samba for SCO UNIX products  may
73 require significant patching of Samba source code. It is much easier to obtain binary
74 packages directly from SCO.
75 </para>
77 </sect1>
79 <sect1>
80 <title>DNIX</title>
82 <para>
83 DNIX has a problem with seteuid() and setegid(). These routines are
84 needed for Samba to work correctly, but they were left out of the DNIX
85 C library for some reason.
86 </para>
88 <para>
89 For this reason Samba by default defines the macro NO_EID in the DNIX
90 section of includes.h. This works around the problem in a limited way,
91 but it is far from ideal, and some things still will not work right.
92 </para>
94 <para> 
95 To fix the problem properly, you need to assemble the following two
96 functions and then either add them to your C library or link them into
97 Samba. Put the following in the file <filename>setegid.s</filename>:
98 </para>
100 <para><programlisting>
101         .globl  _setegid
102 _setegid:
103         moveq   #47,d0
104         movl    #100,a0
105         moveq   #1,d1
106         movl    4(sp),a1
107         trap    #9
108         bccs    1$
109         jmp     cerror
111         clrl    d0
112         rts
113 </programlisting></para>
115 <para>
116 Put this in the file <filename>seteuid.s</filename>:
117 </para>
119 <para><programlisting>
120         .globl  _seteuid
121 _seteuid:
122         moveq   #47,d0
123         movl    #100,a0
124         moveq   #0,d1
125         movl    4(sp),a1
126         trap    #9
127         bccs    1$
128         jmp     cerror
130         clrl    d0
131         rts
132 </programlisting></para>
134 <para>
135 After creating the above files, you then assemble them using
136 </para>
138 <screen>
139 &prompt;<userinput>as seteuid.s</userinput>
140 &prompt;<userinput>as setegid.s</userinput>
141 </screen>
143 <para>
144 that should produce the files <filename>seteuid.o</filename> and 
145 <filename>setegid.o</filename>
146 </para>
148 <para>
149 Then you need to add these to the LIBSM line in the DNIX section of
150 the Samba Makefile. Your LIBSM line will then look something like this:
151 </para>
153 <para><programlisting>
154 LIBSM = setegid.o seteuid.o -ln
155 </programlisting></para>
157 <para> 
158 You should then remove the line:
159 </para>
161 <para><programlisting>
162 #define NO_EID
163 </programlisting></para>
165 <para>from the DNIX section of <filename>includes.h</filename>.</para>
167 </sect1>
169 <sect1>
170 <title>Red Hat Linux</title>
172 <para>
173 By default during installation, some versions of Red Hat Linux add an
174 entry to <filename>/etc/hosts</filename> as follows:
175 <programlisting>
176         127.0.0.1 loopback "hostname"."domainname"
177 </programlisting>
178 </para>
179         
180 <para>
181 This causes Samba to loop back onto the loopback interface.
182 The result is that Samba fails to communicate correctly with
183 the world and therefore may fail to correctly negotiate who
184 is the master browse list holder and who is the master browser.
185 </para>
187 <para>
188 Corrective Action: Delete the entry after the word "loopback"
189 in the line starting 127.0.0.1.
190 </para>
191 </sect1>
193 <sect1>
194 <title>AIX</title>
195 <sect2>
196 <title>Sequential Read Ahead</title>
197 <!-- From an email by William Jojo <jojowil@hvcc.edu> -->
198 <para>
199 Disabling Sequential Read Ahead using <userinput>vmtune -r 0</userinput> improves 
200 Samba performance significantly.
201 </para>
202 </sect2>
203 </sect1>
205 <sect1>
206 <title>Solaris</title>
208 <sect2>
209 <title>Locking Improvements</title>
211 <para>Some people have been experiencing problems with F_SETLKW64/fcntl 
212 when running Samba on Solaris. The built-in file locking mechanism was
213 not scalable. Performance would degrade to the point where processes would
214 get into loops of trying to lock a file. It would try a lock, then fail,
215 then try again. The lock attempt was failing before the grant was
216 occurring. So the visible manifestation of this would be a handful of
217 processes stealing all of the CPU, and when they were truss-ed they would
218 be stuck if F_SETLKW64 loops.
219 </para>
221 <para>
222 Sun released patches for Solaris 2.6, 8, and 9. The patch for Solaris 7
223 has not been released yet.
224 </para>
226 <para>
227 The patch revision for 2.6 is 105181-34, for 8 is 108528-19 and for 9 is 112233-04.
228 </para>
230 <para>
231 After the install of these patches, it is recommended to reconfigure
232 and rebuild Samba.
233 </para>
235 <para>Thanks to Joe Meslovich for reporting this.</para>
237 </sect2>
239 <sect2 id="winbind-solaris9">
240 <title>Winbind on Solaris 9</title>
241 <para>
242 Nsswitch on Solaris 9 refuses to use the Winbind NSS module. This behavior
243 is fixed by Sun in patch <ulink url="http://sunsolve.sun.com/pub-cgi/findPatch.pl?patchId=112960;rev=14">112960-14</ulink>.
244 </para>
245 </sect2>
246 </sect1>
248 </chapter>