/* Machine dependent defintions * $Id: machine.h,v 2.57 2012/04/26 20:54:58 ksb Exp $ */ /* if we have define this to 1, else define to 0 */ #if !defined(USE_STRINGS) #define USE_STRINGS (defined(SUN4)||defined(DYNIX)||defined(EPIX)||defined(IRIX5)) #endif /* If we have issetugid(2) config this on */ #if !defined(HAVE_issetugid) #define HAVE_issetugid ((defined(OPENBSD) && HOSTOS >= 20000)||(defined(FREEBSD) && HOSTOS >= 3000)||defined(NETBSD) || (defined(SUN5) && HOSTOS>50900) || defined(IBMR2) || defined(DARWIN)) #endif /* If we have setresuid config this on (same for setresgid) * NetBSD doesn't have this, and I don't know why -- ksb. */ #if !defined(HAVE_setresuid) #define HAVE_setresuid (defined(HPUX8)||defined(HPUX9)||defined(HPUX10)||defined(HXPUX11)||(defined(FREEBSD)&&HOSOS>40400)||defined(LINUX)||defined(OPENBSD)) #endif #if !defined(HAVE_setresgid) #define HAVE_setresgid HAVE_setresuid #endif /* Really strndup(3) should have been added in ANSI-C99 (I stopped trying to * use it in op. But I'll leave the logic here for reference. */ #if !defined(HAVE_STRNDUP) #if defined(FREEBSD) #define HAVE_STRNDUP (HOSTOS > 70100) #else #if defined(NETBSD) #define HAVE_STRNDUP (HOSTOS >= 40000) #else #if defined(OPENBSD) #define HAVE_STRNDUP (HOSTOS > 40700) #else #define HAVE_STRNDUP 0 #endif /* OpenBSD */ #endif /* NetBSD */ #endif /* FreeBSD */ #endif /* set by recipe */ /* Do we have old style var args? Otherwise, use stdarg (prefered). */ #if !defined(VARARGS) #if SUN4||HPUX9||HPUX10 #define VARARGS 1 #else #define VARARGS 0 #endif #endif #if USE_STRINGS #define strchr index #define strrchr rindex #endif #if !defined(USE_GETSPNAM) #define USE_GETSPNAM defined(SUN5) #endif /* more evolved systems have a inode allocation time (birthtime) */ #if !defined(HAVE_BIRTHTIME) #define HAVE_BIRTHTIME (defined(FREEBSD) && (HOSTOS>=70000)) #endif /* Some older SUN5 hosts do, new ones do not -- give up on it */ #if USE_GETSPNAM #if !defined(HAVE_GETSPUID) #define HAVE_GETSPUID 0 #endif #endif /* Hackish Linux only kernel hook for NFS identity: we do not let you * configure it in the rules, we use the effective uid (gid). */ #if !defined(HAVE_SETFSUID) #define HAVE_SETFSUID defined(LINUX) #endif #if !defined(HAVE_SETFSGID) #define HAVE_SETFGUID (HAVE_SETFSUID) #endif /* Pmax's don't have LOG_AUTH */ #if !defined(LOG_AUTH) #define LOG_AUTH LOG_WARNING #endif /* HPUX is missing 2 sysexits */ #if !defined(EX_CONFIG) #define EX_CONFIG 78 /* Linux, BSD, Solaris have this */ #endif #if !defined(EX_NOTFOUND) #define EX_NOTFOUND 79 /* Solaris, and others have this */ #endif #if !defined(HAVE_CRYPT_H) #define HAVE_CRYPT_H (defined(LINUX)) #endif #if HAVE_CRYPT_H #include #endif #if !defined(USE_PAM) #define USE_PAM (defined(OPENBSD)||defined(NETBSD)||defined(DARWIN)||defined(FREEBSD)||defined(LINUX)||defined(SUN5)||defined(AIX)||defined(HPUX)) #endif /* Where to look for pam configurations, two cases: a file like Solaris, * or a directory like Linux/FREEBSD. If we find the file we don't look * for the directory. */ #if !defined(OP_PAM_FILE) #define OP_PAM_FILE "/etc/pam.conf" #endif #if !defined(OP_PAM_IN) #define OP_PAM_IN "/etc/pam.d" #endif /* Older linux systems don't extern this correctly */ #if defined(LINUX) extern int setfsuid(uid_t); #endif /* Newer Linux systems don't include a sun_run in a local domain socket, * older hosts don't use it, so valgrind complains about the non-init of * the member. This hushes valgrind for QA testing on non-linux hosts. * (Only forced in the test harnesss recipe, no support in production.) */ #if !defined(HAVE_SUN_LEN) #define HAVE_SUN_LEN 0 /* only needed to stiffle valgrind */ #endif