Remove USE_SYSLOG preprocessor conditional, which was always defined

Reported-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar 2022-12-21 17:53:16 +01:00 committed by Iker Pedrosa
parent 350b1e8683
commit 5d7a3b80e9
5 changed files with 0 additions and 20 deletions

View 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 - quick hack, should disappear before anyone notices :).
dnl XXX - I just read the above message :). 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 if test "$ac_cv_func_ruserok" = "yes"; then
AC_DEFINE(RLOGIN, 1, [Define if login should support the -r flag for rlogind.]) 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).]) AC_DEFINE(RUSEROK, 0, [Define to the ruserok() "success" return value (0 or 1).])

View File

@ -85,7 +85,6 @@ static inline void memzero(void *ptr, size_t size)
#endif #endif
#endif #endif
#ifdef USE_SYSLOG
#include <syslog.h> #include <syslog.h>
#ifndef LOG_WARN #ifndef LOG_WARN
@ -132,14 +131,6 @@ static inline void memzero(void *ptr, size_t size)
#define SYSLOG(x) syslog x #define SYSLOG(x) syslog x
#endif /* !ENABLE_NLS */ #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, /* The default syslog settings can now be changed here,
in just one place. */ in just one place. */

View File

@ -132,10 +132,8 @@ static struct itemdef def_table[] = {
#ifndef USE_PAM #ifndef USE_PAM
PAMDEFS PAMDEFS
#endif #endif
#ifdef USE_SYSLOG
{"SYSLOG_SG_ENAB", NULL}, {"SYSLOG_SG_ENAB", NULL},
{"SYSLOG_SU_ENAB", NULL}, {"SYSLOG_SU_ENAB", NULL},
#endif
#ifdef WITH_TCB #ifdef WITH_TCB
{"TCB_AUTH_GROUP", NULL}, {"TCB_AUTH_GROUP", NULL},
{"TCB_SYMLINKS", NULL}, {"TCB_SYMLINKS", NULL},

View File

@ -231,7 +231,6 @@ failure:
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
#ifdef USE_SYSLOG
/* /*
* syslog_sg - log the change of group to 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_login);
free(free_tty); free(free_tty);
} }
#endif /* USE_SYSLOG */
/* /*
* newgrp - change the invokers current real and effective group id * 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 * all successful validations pass through this point. The group id
* will be set, and the group added to the concurrent groupset. * will be set, and the group added to the concurrent groupset.
*/ */
#ifdef USE_SYSLOG
if (getdef_bool ("SYSLOG_SG_ENAB")) { if (getdef_bool ("SYSLOG_SG_ENAB")) {
syslog_sg (name, group); syslog_sg (name, group);
} }
#endif /* USE_SYSLOG */
gid = grp->gr_gid; gid = grp->gr_gid;

View File

@ -188,7 +188,6 @@ static bool restricted_shell (const char *shellname)
static /*@noreturn@*/void su_failure (const char *tty, bool su_to_root) static /*@noreturn@*/void su_failure (const char *tty, bool su_to_root)
{ {
sulog (tty, false, caller_name, name); /* log failed attempt */ sulog (tty, false, caller_name, name); /* log failed attempt */
#ifdef USE_SYSLOG
if (getdef_bool ("SYSLOG_SU_ENAB")) { if (getdef_bool ("SYSLOG_SU_ENAB")) {
SYSLOG ((su_to_root ? LOG_NOTICE : LOG_INFO, SYSLOG ((su_to_root ? LOG_NOTICE : LOG_INFO,
"- %s %s:%s", tty, "- %s %s:%s", tty,
@ -196,7 +195,6 @@ static /*@noreturn@*/void su_failure (const char *tty, bool su_to_root)
('\0' != name[0]) ? name : "???")); ('\0' != name[0]) ? name : "???"));
} }
closelog (); closelog ();
#endif
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_fd = audit_open (); audit_fd = audit_open ();
@ -1050,13 +1048,11 @@ int main (int argc, char **argv)
} }
sulog (caller_tty, true, caller_name, name); /* save SU information */ sulog (caller_tty, true, caller_name, name); /* save SU information */
#ifdef USE_SYSLOG
if (getdef_bool ("SYSLOG_SU_ENAB")) { if (getdef_bool ("SYSLOG_SU_ENAB")) {
SYSLOG ((LOG_INFO, "+ %s %s:%s", caller_tty, SYSLOG ((LOG_INFO, "+ %s %s:%s", caller_tty,
('\0' != caller_name[0]) ? caller_name : "???", ('\0' != caller_name[0]) ? caller_name : "???",
('\0' != name[0]) ? name : "???")); ('\0' != name[0]) ? name : "???"));
} }
#endif
#ifdef USE_PAM #ifdef USE_PAM
/* set primary group id and supplementary groups */ /* set primary group id and supplementary groups */