4 Unix SMB/Netbios implementation.
6 Machine customisation and include handling
7 Copyright (C) Andrew Tridgell 1994-1998
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #define DEFAULT_PRINTING PRINT_AIX
32 #define DEFAULT_PRINTING PRINT_HPUX
36 #define DEFAULT_PRINTING PRINT_QNX
40 #define REPLACE_GETPASS
41 /* on SUNOS4 termios.h conflicts with sys/ioctl.h */
46 #define REPLACE_GETPASS
50 #include <sys/types.h>
58 #ifdef HAVE_SYS_PARAM_H
59 #include <sys/param.h>
66 #ifdef HAVE_SYS_SOCKET_H
67 #include <sys/socket.h>
78 #ifdef TIME_WITH_SYS_TIME
82 #ifdef HAVE_SYS_TIME_H
92 #ifdef HAVE_SYS_FCNTL_H
93 #include <sys/fcntl.h>
103 #ifdef HAVE_SYS_IOCTL_H
104 #include <sys/ioctl.h>
107 #ifdef HAVE_SYS_FILIO_H
108 #include <sys/filio.h>
113 #ifdef HAVE_SYS_WAIT_H
114 #include <sys/wait.h>
132 #ifdef HAVE_SYS_SELECT_H
133 #include <sys/select.h>
136 #ifdef HAVE_SYS_MODE_H
137 /* apparently AIX needs this for S_ISLNK */
139 #include <sys/mode.h>
156 #include <netinet/in.h>
157 #include <arpa/inet.h>
160 #include <sys/file.h>
162 #ifdef HAVE_NETINET_TCP_H
163 #include <netinet/tcp.h>
166 #ifdef HAVE_TERMIOS_H
172 # define NAMLEN(dirent) strlen((dirent)->d_name)
174 # define dirent direct
175 # define NAMLEN(dirent) (dirent)->d_namlen
177 # include <sys/ndir.h>
180 # include <sys/dir.h>
187 #ifdef HAVE_SHARED_MMAP
188 #include <sys/mman.h>
202 #ifdef HAVE_SYS_MOUNT_H
203 #include <sys/mount.h>
206 #ifdef HAVE_SYS_VFS_H
210 #ifdef HAVE_SYS_FS_S5PARAM_H
211 #include <sys/fs/s5param.h>
214 #if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
215 #include <sys/filsys.h>
218 #ifdef HAVE_SYS_STATFS_H
219 # include <sys/statfs.h>
223 #include <sys/dustat.h>
226 #ifdef HAVE_SYS_STATVFS_H
227 #include <sys/statvfs.h>
234 #ifdef HAVE_SYS_SECURITY_H
235 #include <sys/security.h>
237 #define PASSWORD_LENGTH 16
238 #endif /* HAVE_SYS_SECURITY_H */
245 #define uchar unsigned char
248 #ifdef HAVE_UNSIGNED_CHAR
249 #define schar signed char
255 #if (SIZEOF_INT == 4)
257 #elif (SIZEOF_LONG == 4)
259 #elif (SIZEOF_SHORT == 4)
265 #define uint32 unsigned int32
269 #define MIN(a,b) ((a)<(b)?(a):(b))
273 #define MAX(a,b) ((a)>(b)?(a):(b))
276 #ifndef HAVE_STRERROR
277 extern char *sys_errlist[];
278 #define strerror(i) sys_errlist[i]
282 # define strchr index
283 # define strrchr rindex
286 #ifndef HAVE_ERRNO_DECL
290 #ifdef HAVE_BROKEN_GETGROUPS
297 /* Lists, trees, caching, datbase... */
298 #include "ubi_sLinkList.h"
299 #include "ubi_dLinkList.h"
300 #ifndef UBI_BINTREE_H
301 #include "ubi_Cache.h"
302 #endif /* UBI_BINTREE_H */
306 #include "nameserv.h"
308 #include "byteorder.h"
313 #ifndef MAXCODEPAGELINES
314 #define MAXCODEPAGELINES 256
317 /***** automatically generated prototypes *****/
323 #define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___;
328 #define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___;
333 #define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
335 #define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
336 #define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
337 #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
338 #define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
341 #define QSORT_CAST (__compar_fn_t)
345 #define QSORT_CAST (int (*)(const void *, const void *))
348 /* this guess needs to be improved (tridge) */
349 #if defined(STAT_STATVFS) && !defined(SYSV)
353 #ifndef DEFAULT_PRINTING
355 #define DEFAULT_PRINTING PRINT_SYSV
357 #define DEFAULT_PRINTING PRINT_BSD
362 #define SIGCLD SIGCHLD
365 #if (defined(HAVE_SYSV_IPC) || defined(HAVE_SHARED_MMAP))
366 #define FAST_SHARE_MODES 1
374 #ifndef HAVE_UNION_SEMUN
377 struct semid_ds *buf;
378 unsigned short *array;
383 #if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP))
384 #define USE_SMBPASS_DB 1
387 #if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
388 #define OSF1_ENH_SEC 1
391 #if defined(HAVE_PAM_AUTHENTICATE) && defined(HAVE_SECURITY_PAM_APPL_H)
395 #if defined(HAVE_YP_GET_DEFAULT_DOMAIN)
396 #define HAVE_NETGROUP 1
399 #ifndef ALLOW_CHANGE_PASSWORD
400 #if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
401 #define ALLOW_CHANGE_PASSWORD 1
405 /* what is the longest significant password available on your system?
406 Knowing this speeds up password searches a lot */
407 #ifndef PASSWORD_LENGTH
408 #define PASSWORD_LENGTH 8
411 #ifdef REPLACE_INET_NTOA
412 #define inet_ntoa rep_inet_ntoa
420 #define MAXPATHLEN 256
427 #ifndef INADDR_LOOPBACK
428 #define INADDR_LOOPBACK 0x7f000001
432 #define INADDR_NONE 0xffffffff
436 #define crypt ufc_crypt
439 #if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
440 #define ULTRIX_AUTH 1
444 char *strdup(const char *s);
448 void *memmove(void *dest,const void *src,int size);
451 #ifndef HAVE_INITGROUPS
452 int initgroups(char *name,gid_t id);
456 int rename(const char *zfrom, const char *zto);
460 time_t mktime(struct tm *t);
463 #ifndef HAVE_FTRUNCATE
464 int ftruncate(int f,long l);
467 #if (defined(HAVE_SETRESUID) && !defined(HAVE_SETRESUID_DECL))
469 int setresuid(uid_t ruid, uid_t euid, uid_t suid);
470 int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
473 #endif /* _INCLUDES_H */