1 /*$Id: procmail.h,v 1.57 2001/08/25 04:38:40 guenther Exp $*/ 2 3 #include "includes.h" 4 5 #ifdef console 6 #define DEFverbose 1 7 #else 8 #define DEFverbose 0 9 #endif 10 11 #ifdef GROUP_PER_USER 12 #define NO_CHECK_stgid 0 13 #else 14 #define NO_CHECK_stgid 1 15 #endif 16 17 #ifdef TOGGLE_SGID_OK 18 #define CAN_toggle_sgid 1 19 #else 20 #define CAN_toggle_sgid 0 21 #endif 22 23 #ifndef DEFsendmail 24 #define DEFsendmail SENDMAIL 25 #endif 26 #ifndef DEFflagsendmail 27 #define DEFflagsendmail "-oi" 28 #endif 29 30 #ifndef DEFSPATH 31 #define DEFSPATH defSPATH 32 #endif 33 34 #ifndef DEFPATH 35 #define DEFPATH defPATH 36 #endif 37 38 #ifndef ETCRC 39 #define ETCRC 0 40 #endif 41 42 #define mAX32 ((long)(~(unsigned long)0>>1)) /* LONG_MAX */ 43 #define maxMAX32 2147483647L /* the largest we'll use = (2^31)-1 */ 44 #define MAX32 (mAX32>maxMAX32&&maxMAX32>0?maxMAX32:mAX32) /* the minmax */ 45 #define MIN32 (-(long)MAX32) 46 47 #define XTRAlinebuf 2 /* surplus of LINEBUF (assumed by readparse()) */ 48 #ifdef MAXPATHLEN 49 #if MAXPATHLEN>DEFlinebuf /* to protect people from themselves */ 50 #undef DEFlinebuf 51 #define DEFlinebuf MAXPATHLEN 52 #endif 53 #endif 54 55 #define priv_DONTNEED 1 /* don't need root to sgid */ 56 #define priv_START 2 /* we might have root */ 57 58 #define MCDIRSEP (dirsep+STRLEN(dirsep)-1) /* most common DIRSEP */ 59 #define MCDIRSEP_ (dirsep+STRLEN(DIRSEP)-1) 60 61 #define lck_DELAYSIG 1 /* crosscheck the order of this with msg[] */ 62 #define lck_ALLOCLIB 2 /* in sterminate() in retint.c */ 63 #define lck_MEMORY 4 64 #define lck_FORK 8 65 #define lck_FILDES 16 66 #define lck_KERNEL 32 67 #define lck_LOGGING 64 68 #define lck__NOMSG (lck_DELAYSIG|lck_ALLOCLIB|lck_LOGGING) 69 70 extern struct varval{const char*const name;long val;}strenvvar[]; 71 #define locksleep (strenvvar[0].val) 72 #define locktimeout (strenvvar[1].val) 73 #define suspendv (strenvvar[2].val) 74 #define noresretry (strenvvar[3].val) 75 #define timeoutv (strenvvar[4].val) 76 #define verbose (*(volatile long*)&strenvvar[5].val) 77 #define lgabstract (strenvvar[6].val) 78 79 extern struct varstr{const char*const sname,*sval;}strenstr[]; 80 #define shellmetas (strenstr[0].sval) 81 #define lockext (strenstr[1].sval) 82 #define msgprefix (strenstr[2].sval) 83 #define traps (strenstr[3].sval) 84 #define shellflags (strenstr[4].sval) 85 #define fdefault (*(const char*volatile*)&strenstr[5].sval) 86 #define sendmail (strenstr[6].sval) 87 #define flagsendmail (strenstr[7].sval) 88 /* #define PM_version (strenstr[8].sval) */ 89 90 91 extern char*buf,*buf2,*loclock,*thebody; 92 extern const char shell[],lockfile[],newline[],binsh[],unexpeof[],*const*gargv, 93 *const*restargv,*sgetcp,pmrc[],*rcfile,dirsep[],devnull[],empty[],lgname[], 94 executing[],oquote[],cquote[],whilstwfor[],procmailn[],Mail[],home[],host[], 95 *defdeflock,*argv0,exceededlb[],curdir[],slogstr[],conflicting[],orgmail[], 96 insufprivs[],defpath[],errwwriting[],Version[]; 97 extern long filled,lastscore; 98 extern int sh,pwait,retval,retvl2,rc,privileged,ignwerr, 99 lexitcode,accspooldir,crestarg,savstdout,berkeley,mailfilter,erestrict, 100 Deliverymode,ifdepth; 101 extern struct dyna_array ifstack; 102 extern size_t linebuf; 103 extern volatile int nextexit,lcking; 104 extern pid_t thepid; 105 extern uid_t uid; 106 extern gid_t gid,sgid; 107 108 /* 109 * External variables that are checked/changed by the signal handlers: 110 * volatile time_t alrmtime; 111 * pid_t pidfilt,pidchild; 112 * volatile int nextexit,lcking; 113 * size_t linebuf; 114 * static volatile int mailread; in mailfold.c 115 */ 116