From 5d7a3b80e99fe3e3dc833064352699d68ce16a5a Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 21 Dec 2022 17:53:16 +0100 Subject: [PATCH] Remove USE_SYSLOG preprocessor conditional, which was always defined Reported-by: Iker Pedrosa Signed-off-by: Alejandro Colomar --- configure.ac | 1 - lib/defines.h | 9 --------- lib/getdef.c | 2 -- src/newgrp.c | 4 ---- src/su.c | 4 ---- 5 files changed, 20 deletions(-) diff --git a/configure.ac b/configure.ac index 2b3635f1..51bb20ce 100644 --- a/configure.ac +++ b/configure.ac @@ -185,7 +185,6 @@ AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$shadow_cv_passwd_dir/passwd", dnl XXX - quick hack, should disappear before anyone notices :). dnl XXX - I just read the above message :). -AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog().]) if test "$ac_cv_func_ruserok" = "yes"; then AC_DEFINE(RLOGIN, 1, [Define if login should support the -r flag for rlogind.]) AC_DEFINE(RUSEROK, 0, [Define to the ruserok() "success" return value (0 or 1).]) diff --git a/lib/defines.h b/lib/defines.h index d40f05de..b2185793 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -85,7 +85,6 @@ static inline void memzero(void *ptr, size_t size) #endif #endif -#ifdef USE_SYSLOG #include #ifndef LOG_WARN @@ -132,14 +131,6 @@ static inline void memzero(void *ptr, size_t size) #define SYSLOG(x) syslog x #endif /* !ENABLE_NLS */ -#else /* !USE_SYSLOG */ - -#define SYSLOG(x) /* empty */ -#define openlog(a,b,c) /* empty */ -#define closelog() /* empty */ - -#endif /* !USE_SYSLOG */ - /* The default syslog settings can now be changed here, in just one place. */ diff --git a/lib/getdef.c b/lib/getdef.c index dcd1fe72..e90c79ef 100644 --- a/lib/getdef.c +++ b/lib/getdef.c @@ -132,10 +132,8 @@ static struct itemdef def_table[] = { #ifndef USE_PAM PAMDEFS #endif -#ifdef USE_SYSLOG {"SYSLOG_SG_ENAB", NULL}, {"SYSLOG_SU_ENAB", NULL}, -#endif #ifdef WITH_TCB {"TCB_AUTH_GROUP", NULL}, {"TCB_SYMLINKS", NULL}, diff --git a/src/newgrp.c b/src/newgrp.c index 966c25dd..ac18f0ca 100644 --- a/src/newgrp.c +++ b/src/newgrp.c @@ -231,7 +231,6 @@ failure: exit (EXIT_FAILURE); } -#ifdef USE_SYSLOG /* * syslog_sg - log the change of group to syslog * @@ -365,7 +364,6 @@ static void syslog_sg (const char *name, const char *group) free(free_login); free(free_tty); } -#endif /* USE_SYSLOG */ /* * newgrp - change the invokers current real and effective group id @@ -665,11 +663,9 @@ int main (int argc, char **argv) * all successful validations pass through this point. The group id * will be set, and the group added to the concurrent groupset. */ -#ifdef USE_SYSLOG if (getdef_bool ("SYSLOG_SG_ENAB")) { syslog_sg (name, group); } -#endif /* USE_SYSLOG */ gid = grp->gr_gid; diff --git a/src/su.c b/src/su.c index 6cd82fca..b2f0378b 100644 --- a/src/su.c +++ b/src/su.c @@ -188,7 +188,6 @@ static bool restricted_shell (const char *shellname) static /*@noreturn@*/void su_failure (const char *tty, bool su_to_root) { sulog (tty, false, caller_name, name); /* log failed attempt */ -#ifdef USE_SYSLOG if (getdef_bool ("SYSLOG_SU_ENAB")) { SYSLOG ((su_to_root ? LOG_NOTICE : LOG_INFO, "- %s %s:%s", tty, @@ -196,7 +195,6 @@ static /*@noreturn@*/void su_failure (const char *tty, bool su_to_root) ('\0' != name[0]) ? name : "???")); } closelog (); -#endif #ifdef WITH_AUDIT audit_fd = audit_open (); @@ -1050,13 +1048,11 @@ int main (int argc, char **argv) } sulog (caller_tty, true, caller_name, name); /* save SU information */ -#ifdef USE_SYSLOG if (getdef_bool ("SYSLOG_SU_ENAB")) { SYSLOG ((LOG_INFO, "+ %s %s:%s", caller_tty, ('\0' != caller_name[0]) ? caller_name : "???", ('\0' != name[0]) ? name : "???")); } -#endif #ifdef USE_PAM /* set primary group id and supplementary groups */