]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Remove USE_SYSLOG preprocessor conditional, which was always defined
authorAlejandro Colomar <alx@kernel.org>
Wed, 21 Dec 2022 16:53:16 +0000 (17:53 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Thu, 22 Dec 2022 10:44:36 +0000 (11:44 +0100)
Reported-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
configure.ac
lib/defines.h
lib/getdef.c
src/newgrp.c
src/su.c

index 2b3635f1c21ca8ff88c29bb453986bfaadbf6f87..51bb20ce8036cd2ff5d4fddb1dab71c39cda64a4 100644 (file)
@@ -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).])
index d40f05defd8195c2de4654697123530427ef3cb7..b2185793fd018a235237a4b92cd1af0070d777d7 100644 (file)
@@ -85,7 +85,6 @@ static inline void memzero(void *ptr, size_t size)
 #endif
 #endif
 
-#ifdef USE_SYSLOG
 #include <syslog.h>
 
 #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.  */
 
index dcd1fe7209a90b1cba4a0bb1f13df878d0a2dd91..e90c79ef6c75dfb564d3f82b279866711b6176af 100644 (file)
@@ -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},
index 966c25dd32ee29717e57e963d6bb8b32312cdd34..ac18f0ca1c81eb49a7af1bb7703ab51c609127a5 100644 (file)
@@ -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;
 
index 6cd82fca949eefb908a948ed2ee6b06d176baebf..b2f0378b9ea298bdccb9a142370cdb6b09eb0cb8 100644 (file)
--- 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 */