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>
52 #ifdef TIME_WITH_SYS_TIME
56 #ifdef HAVE_SYS_TIME_H
63 #ifdef HAVE_SYS_RESOURCE_H
64 #include <sys/resource.h>
74 #ifdef HAVE_SYS_PARAM_H
75 #include <sys/param.h>
82 #ifdef HAVE_SYS_SOCKET_H
83 #include <sys/socket.h>
105 #ifdef HAVE_SYS_FCNTL_H
106 #include <sys/fcntl.h>
110 #include <sys/stat.h>
116 #ifdef HAVE_SYS_IOCTL_H
117 #include <sys/ioctl.h>
120 #ifdef HAVE_SYS_FILIO_H
121 #include <sys/filio.h>
126 #ifdef HAVE_SYS_WAIT_H
127 #include <sys/wait.h>
145 #ifdef HAVE_SYS_SELECT_H
146 #include <sys/select.h>
149 #ifdef HAVE_SYS_MODE_H
150 /* apparently AIX needs this for S_ISLNK */
152 #include <sys/mode.h>
169 #include <netinet/in.h>
170 #include <arpa/inet.h>
173 #include <sys/file.h>
175 #ifdef HAVE_NETINET_TCP_H
176 #include <netinet/tcp.h>
179 #ifdef HAVE_TERMIOS_H
185 # define NAMLEN(dirent) strlen((dirent)->d_name)
187 # define dirent direct
188 # define NAMLEN(dirent) (dirent)->d_namlen
190 # include <sys/ndir.h>
193 # include <sys/dir.h>
200 #ifdef HAVE_SHARED_MMAP
201 #include <sys/mman.h>
215 #ifdef HAVE_SYS_MOUNT_H
216 #include <sys/mount.h>
219 #ifdef HAVE_SYS_VFS_H
223 #ifdef HAVE_SYS_FS_S5PARAM_H
224 #include <sys/fs/s5param.h>
227 #if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
228 #include <sys/filsys.h>
231 #ifdef HAVE_SYS_STATFS_H
232 # include <sys/statfs.h>
236 #include <sys/dustat.h>
239 #ifdef HAVE_SYS_STATVFS_H
240 #include <sys/statvfs.h>
247 #ifdef HAVE_SYS_SECURITY_H
248 #include <sys/security.h>
250 #define PASSWORD_LENGTH 16
251 #endif /* HAVE_SYS_SECURITY_H */
257 #ifdef HAVE_RPC_TYPES_H
258 #include <rpc/types.h>
261 #ifdef HAVE_RPC_XDR_H
265 #ifdef HAVE_RPC_AUTH_H
266 #include <rpc/auth.h>
269 #ifdef HAVE_RPC_CLNT_H
270 #include <rpc/clnt.h>
273 #ifdef HAVE_RPCSVC_YP_PROT_H
274 #include <rpcsvc/yp_prot.h>
277 #ifdef HAVE_RPCSVC_YPCLNT_H
278 #include <rpcsvc/ypclnt.h>
282 #define uchar unsigned char
285 #ifdef HAVE_UNSIGNED_CHAR
286 #define schar signed char
292 #if (SIZEOF_INT == 4)
294 #elif (SIZEOF_LONG == 4)
296 #elif (SIZEOF_SHORT == 4)
302 #define uint32 unsigned int32
306 #define MIN(a,b) ((a)<(b)?(a):(b))
310 #define MAX(a,b) ((a)>(b)?(a):(b))
313 #ifndef HAVE_STRERROR
314 extern char *sys_errlist[];
315 #define strerror(i) sys_errlist[i]
319 # define strchr index
320 # define strrchr rindex
323 #ifndef HAVE_ERRNO_DECL
327 #ifdef HAVE_BROKEN_GETGROUPS
334 /* Lists, trees, caching, datbase... */
335 #include "ubi_sLinkList.h"
336 #include "ubi_dLinkList.h"
337 #include "dlinklist.h"
339 #ifndef UBI_BINTREE_H
340 #include "ubi_Cache.h"
341 #endif /* UBI_BINTREE_H */
345 #include "nameserv.h"
347 #include "byteorder.h"
354 #ifndef MAXCODEPAGELINES
355 #define MAXCODEPAGELINES 256
358 /***** automatically generated prototypes *****/
364 #define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___;
369 #define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___;
374 #define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
376 #define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
377 #define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
378 #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
379 #define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
382 #define QSORT_CAST (__compar_fn_t)
386 #define QSORT_CAST (int (*)(const void *, const void *))
389 /* this guess needs to be improved (tridge) */
390 #if defined(STAT_STATVFS) && !defined(SYSV)
394 #ifndef DEFAULT_PRINTING
396 #define DEFAULT_PRINTING PRINT_SYSV
398 #define DEFAULT_PRINTING PRINT_BSD
403 #define SIGCLD SIGCHLD
406 #if (defined(HAVE_SYSV_IPC) || defined(HAVE_SHARED_MMAP))
407 #define FAST_SHARE_MODES 1
415 #ifndef HAVE_UNION_SEMUN
418 struct semid_ds *buf;
419 unsigned short *array;
424 #if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP))
425 #define USE_SMBPASS_DB 1
428 #if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
429 #define OSF1_ENH_SEC 1
432 #if defined(HAVE_PAM_AUTHENTICATE) && defined(HAVE_SECURITY_PAM_APPL_H)
436 #if defined(HAVE_YP_GET_DEFAULT_DOMAIN)
437 #define HAVE_NETGROUP 1
440 #ifndef ALLOW_CHANGE_PASSWORD
441 #if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
442 #define ALLOW_CHANGE_PASSWORD 1
446 /* what is the longest significant password available on your system?
447 Knowing this speeds up password searches a lot */
448 #ifndef PASSWORD_LENGTH
449 #define PASSWORD_LENGTH 8
452 #ifdef REPLACE_INET_NTOA
453 #define inet_ntoa rep_inet_ntoa
461 #define MAXPATHLEN 256
468 #ifndef INADDR_LOOPBACK
469 #define INADDR_LOOPBACK 0x7f000001
473 #define INADDR_NONE 0xffffffff
477 #define crypt ufc_crypt
480 #if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
481 #define ULTRIX_AUTH 1
485 char *strdup(const char *s);
489 void *memmove(void *dest,const void *src,int size);
492 #ifndef HAVE_INITGROUPS
493 int initgroups(char *name,gid_t id);
497 int rename(const char *zfrom, const char *zto);
501 time_t mktime(struct tm *t);
504 #ifndef HAVE_FTRUNCATE
505 int ftruncate(int f,long l);
508 #if (defined(HAVE_SETRESUID) && !defined(HAVE_SETRESUID_DECL))
510 int setresuid(uid_t ruid, uid_t euid, uid_t suid);
511 int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
514 #if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
515 #define bzero(a,b) memset((a),'\0',(b))
518 #endif /* _INCLUDES_H */