now passes -Wall

This commit is contained in:
Todd C. Miller
1995-09-23 20:47:54 +00:00
parent f0ac53072c
commit 02036880ce
3 changed files with 21 additions and 8 deletions

View File

@@ -112,8 +112,10 @@ static void check_passwd __P((void));
static int touch __P((char *)); static int touch __P((char *));
static void update_timestamp __P((void)); static void update_timestamp __P((void));
static void reminder __P((void)); static void reminder __P((void));
static char *osf_C2_crypt __P((char *, char *));
static int sudo_krb_validate_user __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)); int user_is_exempt __P((void));
/* /*
@@ -218,7 +220,7 @@ static int check_timestamp()
/* /*
* walk through the path one directory at a time * 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'; *p = '\0';
if (stat(timestampfile, &statbuf) < 0) { if (stat(timestampfile, &statbuf) < 0) {
if (strcmp(timestampfile, _PATH_SUDO_TIMEDIR)) if (strcmp(timestampfile, _PATH_SUDO_TIMEDIR))
@@ -354,9 +356,9 @@ static void update_timestamp()
void remove_timestamp() void remove_timestamp()
{ {
#ifdef USE_TTY_TICKETS
char *p; char *p;
#ifdef USE_TTY_TICKETS
if (p = strrchr(tty, '/')) if (p = strrchr(tty, '/'))
p++; p++;
else else

View File

@@ -43,6 +43,9 @@ static char rcsid[] = "$Id$";
#include "config.h" #include "config.h"
#include <stdio.h> #include <stdio.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif /* STDC_HEADERS */
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif /* HAVE_UNISTD_H */ #endif /* HAVE_UNISTD_H */
@@ -52,11 +55,15 @@ static char rcsid[] = "$Id$";
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
#include <strings.h> #include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
#include <malloc.h>
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
#include <signal.h> #include <signal.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/param.h> #include <sys/param.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h>
#include <sys/errno.h> #include <sys/errno.h>
#include <netinet/in.h> #include <netinet/in.h>
@@ -119,11 +126,11 @@ static void syslog_wrapper(pri, fmt, arg1, arg2)
void log_error(code) void log_error(code)
int code; int code;
{ {
mode_t oldmask;
char *p; char *p;
int count; int count;
time_t now; time_t now;
#if (LOGGING & SLOG_FILE) #if (LOGGING & SLOG_FILE)
mode_t oldmask;
FILE *fp; FILE *fp;
#endif /* LOGGING & SLOG_FILE */ #endif /* LOGGING & SLOG_FILE */
#if (LOGGING & SLOG_SYSLOG) #if (LOGGING & SLOG_SYSLOG)
@@ -184,7 +191,8 @@ void log_error(code)
case GLOBAL_NO_PW_ENT: case GLOBAL_NO_PW_ENT:
(void) sprintf(p, (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; break;
case PASSWORD_NOT_CORRECT: case PASSWORD_NOT_CORRECT:
@@ -569,8 +577,7 @@ void inform_user(code)
break; break;
case PASSWORD_NOT_CORRECT: case PASSWORD_NOT_CORRECT:
(void) fprintf(stderr, "Password not entered correctly\n\n", (void) fprintf(stderr, "Password not entered correctly\n\n");
TRIES_FOR_PASSWORD);
break; break;
case PASSWORDS_NOT_CORRECT: case PASSWORDS_NOT_CORRECT:

View File

@@ -31,6 +31,9 @@ static char rcsid[] = "$Id$";
#include "config.h" #include "config.h"
#include <stdio.h> #include <stdio.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif /* STDC_HEADERS */
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif /* HAVE_UNISTD_H */ #endif /* HAVE_UNISTD_H */
@@ -47,6 +50,7 @@ static char rcsid[] = "$Id$";
#include <sys/param.h> #include <sys/param.h>
#include <sys/types.h> #include <sys/types.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include <sys/stat.h> #include <sys/stat.h>
#if HAVE_DIRENT_H #if HAVE_DIRENT_H
@@ -84,7 +88,7 @@ int validate(check_cmnd)
int check_cmnd; int check_cmnd;
{ {
FILE *sudoers_fp; FILE *sudoers_fp;
int i, return_code; int return_code;
/* become sudoers file owner */ /* become sudoers file owner */
set_perms(PERM_SUDOERS); set_perms(PERM_SUDOERS);