]> granicus.if.org Git - sudo/commitdiff
-Wall
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 18 Nov 1998 03:51:10 +0000 (03:51 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 18 Nov 1998 03:51:10 +0000 (03:51 +0000)
21 files changed:
check.c
check_sia.c
find_path.c
getcwd.c
getspwuid.c
goodpath.c
interfaces.c
logging.c
lsearch.c
parse.c
parse.lex
parse.yacc
putenv.c
secureware.c
strdup.c
sudo.c
sudo_setenv.c
testsudoers.c
tgetpass.c
utime.c
visudo.c

diff --git a/check.c b/check.c
index 3cff4378444c33b11b0d2c4287b28caaf50bf133..2cdf672814f07e8a5af03fbb39291d6b0734048b 100644 (file)
--- a/check.c
+++ b/check.c
@@ -36,7 +36,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
@@ -290,7 +290,7 @@ static int check_timestamp()
        } else {
            /* check the time against the timestamp file */
            now = time((time_t *) NULL);
-           if (TIMEOUT && now - statbuf.st_mtime < 60 * TIMEOUT)
+           if (TIMEOUT && now - statbuf.st_mtime < 60 * TIMEOUT) {
                /* check for bogus time on the stampfile */
                if (statbuf.st_mtime > now + 60 * TIMEOUT * 2) {
                    timestamp_is_old = 2;       /* bogus time value */
@@ -300,8 +300,9 @@ static int check_timestamp()
                } else {
                    timestamp_is_old = 0;       /* time value is reasonable */
                }
-           else
+           } else {
                timestamp_is_old = 1;   /* else make 'em enter password */
+           }
        }
     }
     /*
index 12d2eb3eaa9f6c7ebb0408ac3b1752909736cbbd..1bf69dc9f2e31ff435355cee4799b3546495b939 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index bdc93c08665627df967aea6517fb6c5332e2a815..85cf8c898563ce7ef7d4ef64d4463e86b69f5bb9 100644 (file)
@@ -29,7 +29,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index d1f87f84773ab1f5208ddbe87e25bbd237569e3c..2a3e9e9832989df17ca6096146c55f24b6e613cd 100644 (file)
--- a/getcwd.c
+++ b/getcwd.c
@@ -32,7 +32,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getcwd.c,v 1.5 1998/08/14 21:39:26 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: getcwd.c,v 1.5 1998/08/14 21:39:26 deraadt Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include "config.h"
index a79a9071312226bf50f980faef94fcc0aeef9283..20123b5aeb1e9425b0d2030bc7a31c5b8728c9f6 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index 6096ac1dcda40a97c40b103b69f9d482a1528df7..510269ca681cfa8eddc0a3886a52419d15844419 100644 (file)
@@ -29,7 +29,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index ecaf7953d10b483801526afc7dab252e9394d69c..8d0e0b0b8a70b297da37bd329480324e076c05c0 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index 61463ea83c36d19d6ea0655fdc3fbc8480fd0bd2..0b3d8766571a01a8513567702daa59c2c9f6ad03 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -37,7 +37,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index 8b758a5b49326d992b0f8f5a485a8b67021a1495..3e07ff3f7a8bce5bd2c3c59f41633003f01f046d 100644 (file)
--- a/lsearch.c
+++ b/lsearch.c
@@ -38,7 +38,7 @@
 static char sccsid[] = "@(#)lsearch.c  8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
diff --git a/parse.c b/parse.c
index d4f780fde8da55bf672588ba50e899a07f8c9457..52893cdcbbaaedd942b2e16c509853438646cf4f 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -25,7 +25,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
@@ -156,12 +156,13 @@ int validate(check_cmnd)
      */
     if (check_cmnd == FALSE)
        while (top) {
-           if (host_matches == TRUE)
+           if (host_matches == TRUE) {
                /* user may always do validate or list on allowed hosts */
                if (no_passwd == TRUE)
                    return(VALIDATE_OK_NOPASS);
                else
                    return(VALIDATE_OK);
+           }
            top--;
        }
     else
index 930bfa6e0412b44cb104d77a1f251bbf548c0f0e..d8e205de5166f9fc3c31566eb59ef5168b4f4ad4 100644 (file)
--- a/parse.lex
+++ b/parse.lex
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index eeba7df76d66fc2fa040f5e6ad7734684d8bed55..089152ab05926901232fa606ca30d02f6215a8ae 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index e9d94cf5f06f86bac3c579c8bd178c64ddef8b22..1c791d7255b1b30e5129eb5e2a11e7d558f784eb 100644 (file)
--- a/putenv.c
+++ b/putenv.c
@@ -25,7 +25,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index 52f76ec906fb65851ea398306af29a93b0381bf4..bafce86cc9c7949bb2de4adb451206c5f8066b2e 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index 9e87dd53cd6a1b76b5c7a74470b5ff94f5568158..c4d00af9e3e1a81ed2e8acd38aa1b130a6df3644 100644 (file)
--- a/strdup.c
+++ b/strdup.c
@@ -33,7 +33,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
diff --git a/sudo.c b/sudo.c
index 8893a7b8d2ad29f16db94ecc97dfa648031818ba..c99018fc22820885054d2cbcea46c3d0233825f3 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -51,7 +51,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #define MAIN
index d4a55250789e3bb9d6c6962f336069f665db959d..54f1bbdf546a637f60406e8ac6f2f0496c568392 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index 5896507d0c7f889241aefdbdc8731cb5d41d0f8d..a70b495959fc903efe22beb18a2831037ddf36f8 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index a3aae51d206b78c450de77bcb1f0e2bad7472d88..8a71f59f59901a9dff246c06d09a5d571d6ce65b 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
diff --git a/utime.c b/utime.c
index 3802d6293a6247a916a571d90a020af73f9cf9eb..e87f4d1c6e17f3db7b32866e80b47ef3697b3694 100644 (file)
--- a/utime.c
+++ b/utime.c
@@ -27,7 +27,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
index b2fe9842490b7b63d781169e5f3505f2eaf60f2c..2d3f966fc8b9e0c281c6984d959f08357f7d0974 100644 (file)
--- a/visudo.c
+++ b/visudo.c
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id$";
 #endif /* lint */
 
 #include "config.h"
@@ -144,15 +144,16 @@ int main(argc, argv)
      * If passesd -V then print version, else print usage
      * if any other option...
      */
-    if (argc == 2)
+    if (argc == 2) {
        if (!strcmp(Argv[1], "-V")) {
            (void) printf("visudo version %s\n", version);
            exit(0);
        } else {
            usage();
        }
-    else if (argc != 1)
+    } else if (argc != 1) {
        usage();
+    }
 
     /* user_pw_ent needs to point to something... */
     if ((user_pw_ent = getpwuid(getuid())) == NULL) {
@@ -319,7 +320,7 @@ int main(argc, argv)
      * rename(2)'d to sudoers.  If the rename(2) fails we try using
      * mv(1) in case stmp and sudoers are on different filesystems.
      */
-    if (rename(stmp, sudoers))
+    if (rename(stmp, sudoers)) {
        if (errno == EXDEV) {
            char *tmpbuf;
 
@@ -353,6 +354,7 @@ int main(argc, argv)
            perror("");
            Exit(-1);
        }
+    }
 
     return(0);
 }