From 66c246fc170d6c3307593fe84f4912da106d4467 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 19 Mar 1997 02:56:54 +0000 Subject: cpp-indent Change a few #ifdef to #if. Remove 3 spurious #ifdef that were guarding an #undef each. --- src/su.c | 56 +++++++++++++++++++++++++------------------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/src/su.c b/src/su.c index 6f361161f..ed0e603e1 100644 --- a/src/su.c +++ b/src/su.c @@ -77,27 +77,21 @@ #include #include "system.h" -#if defined(HAVE_SYSLOG_H) && defined(HAVE_SYSLOG) -#include -#else /* !HAVE_SYSLOG_H */ -#ifdef SYSLOG_SUCCESS -#undef SYSLOG_SUCCESS -#endif -#ifdef SYSLOG_FAILURE -#undef SYSLOG_FAILURE -#endif -#ifdef SYSLOG_NON_ROOT -#undef SYSLOG_NON_ROOT +#if HAVE_SYSLOG_H && HAVE_SYSLOG +# include +#else +# undef SYSLOG_SUCCESS +# undef SYSLOG_FAILURE +# undef SYSLOG_NON_ROOT #endif -#endif /* !HAVE_SYSLOG_H */ #ifdef _POSIX_VERSION -#include +# include #else /* not _POSIX_VERSION */ struct passwd *getpwuid (); struct group *getgrgid (); uid_t getuid (); -#include +# include #endif /* not _POSIX_VERSION */ #ifndef HAVE_ENDGRENT @@ -108,28 +102,28 @@ uid_t getuid (); # define endpwent() ((void) 0) #endif -#ifdef HAVE_SHADOW_H -#include +#if HAVE_SHADOW_H +# include #endif #include "error.h" -#ifdef HAVE_PATHS_H -#include +#if HAVE_PATHS_H +# include #endif /* The default PATH for simulated logins to non-superuser accounts. */ #ifdef _PATH_DEFPATH -#define DEFAULT_LOGIN_PATH _PATH_DEFPATH +# define DEFAULT_LOGIN_PATH _PATH_DEFPATH #else -#define DEFAULT_LOGIN_PATH ":/usr/ucb:/bin:/usr/bin" +# define DEFAULT_LOGIN_PATH ":/usr/ucb:/bin:/usr/bin" #endif /* The default PATH for simulated logins to superuser accounts. */ #ifdef _PATH_DEFPATH_ROOT -#define DEFAULT_ROOT_LOGIN_PATH _PATH_DEFPATH_ROOT +# define DEFAULT_ROOT_LOGIN_PATH _PATH_DEFPATH_ROOT #else -#define DEFAULT_ROOT_LOGIN_PATH "/usr/ucb:/bin:/usr/bin:/etc" +# define DEFAULT_ROOT_LOGIN_PATH "/usr/ucb:/bin:/usr/bin:/etc" #endif /* The shell to run if none is given in the user's passwd entry. */ @@ -228,10 +222,10 @@ log_su (const struct passwd *pw, int successful) { const char *new_user, *old_user, *tty; -#ifndef SYSLOG_NON_ROOT +# ifndef SYSLOG_NON_ROOT if (pw->pw_uid) return; -#endif +# endif new_user = pw->pw_name; /* The utmp entry (via getlogin) is probably the best way to identify the user, especially if someone su's from a su-shell. */ @@ -248,20 +242,20 @@ log_su (const struct passwd *pw, int successful) tty = "none"; /* 4.2BSD openlog doesn't have the third parameter. */ openlog (basename (program_name), 0 -#ifdef LOG_AUTH +# ifdef LOG_AUTH , LOG_AUTH -#endif +# endif ); syslog (LOG_NOTICE, -#ifdef SYSLOG_NON_ROOT +# ifdef SYSLOG_NON_ROOT "%s(to %s) %s on %s", -#else +# else "%s%s on %s", -#endif +# endif successful ? "" : "FAILED SU ", -#ifdef SYSLOG_NON_ROOT +# ifdef SYSLOG_NON_ROOT new_user, -#endif +# endif old_user, tty); closelog (); } -- cgit v1.2.3-54-g00ecf