From 02036880ce4ac2ad173c5a1fb8b9bce1e3f67a96 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 23 Sep 1995 20:47:54 +0000 Subject: [PATCH] now passes -Wall --- check.c | 8 +++++--- logging.c | 15 +++++++++++---- parse.c | 6 +++++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/check.c b/check.c index 11543f801..e9b438a50 100644 --- a/check.c +++ b/check.c @@ -112,8 +112,10 @@ static void check_passwd __P((void)); static int touch __P((char *)); static void update_timestamp __P((void)); static void reminder __P((void)); -static char *osf_C2_crypt __P((char *, char *)); static int sudo_krb_validate_user __P((char *, char *)); +#if defined(__alpha) && defined(SHADOW_TYPE) && (SHADOW_TYPE == SPW_SECUREWARE) +static char *osf_C2_crypt __P((char *, char *)); +#endif /* __alpha && (SHADOW_TYPE == SPW_SECUREWARE) */ int user_is_exempt __P((void)); /* @@ -218,7 +220,7 @@ static int check_timestamp() /* * walk through the path one directory at a time */ - for (p = timestampfile + 1; p = strchr(p, '/'); *p++ = '/') { + for (p = timestampfile + 1; (p = strchr(p, '/')); *p++ = '/') { *p = '\0'; if (stat(timestampfile, &statbuf) < 0) { if (strcmp(timestampfile, _PATH_SUDO_TIMEDIR)) @@ -354,9 +356,9 @@ static void update_timestamp() void remove_timestamp() { +#ifdef USE_TTY_TICKETS char *p; -#ifdef USE_TTY_TICKETS if (p = strrchr(tty, '/')) p++; else diff --git a/logging.c b/logging.c index 8e516c6d2..049972e95 100644 --- a/logging.c +++ b/logging.c @@ -43,6 +43,9 @@ static char rcsid[] = "$Id$"; #include "config.h" #include +#ifdef STDC_HEADERS +#include +#endif /* STDC_HEADERS */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ @@ -52,11 +55,15 @@ static char rcsid[] = "$Id$"; #ifdef HAVE_STRINGS_H #include #endif /* HAVE_STRINGS_H */ +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) +#include +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include #include #include #include #include +#include #include #include @@ -119,11 +126,11 @@ static void syslog_wrapper(pri, fmt, arg1, arg2) void log_error(code) int code; { - mode_t oldmask; char *p; int count; time_t now; #if (LOGGING & SLOG_FILE) + mode_t oldmask; FILE *fp; #endif /* LOGGING & SLOG_FILE */ #if (LOGGING & SLOG_SYSLOG) @@ -184,7 +191,8 @@ void log_error(code) case GLOBAL_NO_PW_ENT: (void) sprintf(p, - "There is no passwd entry for uid %d (TTY=%s). ", uid, tty); + "There is no passwd entry for uid %ld (TTY=%s). ", + (long) uid, tty); break; case PASSWORD_NOT_CORRECT: @@ -569,8 +577,7 @@ void inform_user(code) break; case PASSWORD_NOT_CORRECT: - (void) fprintf(stderr, "Password not entered correctly\n\n", - TRIES_FOR_PASSWORD); + (void) fprintf(stderr, "Password not entered correctly\n\n"); break; case PASSWORDS_NOT_CORRECT: diff --git a/parse.c b/parse.c index 7d7964de5..d21a02977 100644 --- a/parse.c +++ b/parse.c @@ -31,6 +31,9 @@ static char rcsid[] = "$Id$"; #include "config.h" #include +#ifdef STDC_HEADERS +#include +#endif /* STDC_HEADERS */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ @@ -47,6 +50,7 @@ static char rcsid[] = "$Id$"; #include #include #include +#include #include #include #if HAVE_DIRENT_H @@ -84,7 +88,7 @@ int validate(check_cmnd) int check_cmnd; { FILE *sudoers_fp; - int i, return_code; + int return_code; /* become sudoers file owner */ set_perms(PERM_SUDOERS);