--- sysklogd-1.4.1/syslogd.c Sun Mar 11 20:40:10 2001 +++ sysklogd-1.4.1-new/syslogd.c Thu Oct 25 14:29:34 2001 @@ -487,7 +487,6 @@ #include #include -#include #include #include #include @@ -577,6 +576,16 @@ #define INTERNAL_NOPRI 0x10 /* the "no priority" priority */ #define TABLE_NOPRI 0 /* Value to indicate no priority in f_pmask */ #define TABLE_ALLPRI 0xFF /* Value to indicate all priorities in f_pmask */ +#ifndef LOG_MAKEPRI +#define LOG_MAKEPRI(f,p) (((f) << 3) + (p)) +#endif +#ifndef LOG_FAC +#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) +#endif +#ifndef LOG_PRI +#define LOG_PRI(p) ((p) & LOG_PRIMASK) +#endif + #define LOG_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0) /* mark "facility" */ /* @@ -694,7 +703,9 @@ struct code FacNames[] = { {"auth", LOG_AUTH}, +#ifdef LOG_AUTHPRIV {"authpriv", LOG_AUTHPRIV}, +#endif {"cron", LOG_CRON}, {"daemon", LOG_DAEMON}, {"kern", LOG_KERN}, @@ -1235,12 +1246,14 @@ /* We need to enable BSD compatibility. Otherwise an attacker * could flood our log files by sending us tons of ICMP errors. */ +#ifdef SO_BSDCOMPAT if (setsockopt(fd, SOL_SOCKET, SO_BSDCOMPAT, \ (char *) &on, sizeof(on)) < 0) { logerror("setsockopt(BSDCOMPAT), suspending inet"); close(fd); return -1; } +#endif if (bind(fd, (struct sockaddr *) &sin, sizeof(sin)) < 0) { logerror("bind, suspending inet"); close(fd); @@ -1512,10 +1525,10 @@ int pri; { static char res[20]; - CODE *c_pri, *c_fac; + struct code *c_pri, *c_fac; - for (c_fac = facilitynames; c_fac->c_name && !(c_fac->c_val == LOG_FAC(pri)<<3); c_fac++); - for (c_pri = prioritynames; c_pri->c_name && !(c_pri->c_val == LOG_PRI(pri)); c_pri++); + for (c_fac = FacNames; c_fac->c_name && !(c_fac->c_val == LOG_FAC(pri)<<3); c_fac++); + for (c_pri = PriNames; c_pri->c_name && !(c_pri->c_val == LOG_PRI(pri)); c_pri++); snprintf (res, sizeof(res), "%s.%s<%d>", c_fac->c_name, c_pri->c_name, pri);