The second argument to init_parser() is now bool.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 2 Aug 2012 19:40:11 +0000 (15:40 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 2 Aug 2012 19:40:11 +0000 (15:40 -0400)
plugins/sudoers/gram.c
plugins/sudoers/gram.y
plugins/sudoers/parse.c
plugins/sudoers/parse.h
plugins/sudoers/testsudoers.c
plugins/sudoers/visudo.c

index b4b40871d012212964384de445bd2c32d8ad5ea8..2ce2a9c6d3f452db1433269f87afedf29a4de853 100644 (file)
@@ -756,7 +756,7 @@ add_userspec(struct member *members, struct privilege *privs)
  * the current sudoers file to path.
  */
 void
-init_parser(const char *path, int quiet)
+init_parser(const char *path, bool quiet)
 {
     struct defaults *d;
     struct member *m, *binding;
index b85141b444ac047dec3142ede97dda5d7df49e81..71f5b172b8f1c9b8ed675fb6502bcaae96e5decc 100644 (file)
@@ -753,7 +753,7 @@ add_userspec(struct member *members, struct privilege *privs)
  * the current sudoers file to path.
  */
 void
-init_parser(const char *path, int quiet)
+init_parser(const char *path, bool quiet)
 {
     struct defaults *d;
     struct member *m, *binding;
index 3468a8e3026c19d4109e6eb3cc4b2d319a9c94f9..1d37a0342a266ea1cc74b5164ffe10a249d881f6 100644 (file)
@@ -96,7 +96,7 @@ sudo_file_close(struct sudo_nss *nss)
     debug_decl(sudo_file_close, SUDO_DEBUG_NSS)
 
     /* Free parser data structures and close sudoers file. */
-    init_parser(NULL, 0);
+    init_parser(NULL, false);
     if (nss->handle != NULL) {
        fclose(nss->handle);
        nss->handle = NULL;
@@ -116,7 +116,7 @@ sudo_file_parse(struct sudo_nss *nss)
     if (nss->handle == NULL)
        debug_return_int(-1);
 
-    init_parser(sudoers_file, 0);
+    init_parser(sudoers_file, false);
     yyin = nss->handle;
     if (yyparse() != 0 || parse_error) {
        if (errorlineno != -1) {
index 0c4a4d7fcda922dfd61720ca2be74b07923dab51..3f7c451aeb41e857a9b09c3cca6949a4cb391e2e 100644 (file)
@@ -198,7 +198,7 @@ void alias_free(void *);
 void alias_apply(int (*)(void *, void *), void *);
 void init_aliases(void);
 void init_lexer(void);
-void init_parser(const char *, int);
+void init_parser(const char *, bool);
 int alias_compare(const void *, const void *);
 
 #endif /* _SUDO_PARSE_H */
index f0c84fc26a807859ba6e5e95eddf78301cc179be..576458c1a70be67773d501ed7ed4401f7e7120c7 100644 (file)
@@ -268,7 +268,7 @@ main(int argc, char *argv[])
        set_interfaces(p);
 
     /* Allocate space for data structures in the parser. */
-    init_parser("sudoers", 0);
+    init_parser("sudoers", false);
 
     if (yyparse() != 0 || parse_error) {
        parse_error = true;
index 8175b6efc09eb581976829386502638acb09570b..284c454be0b61538985b43a856844e4e704db871 100644 (file)
@@ -188,7 +188,7 @@ main(int argc, char *argv[])
                (void) printf(_("%s grammar version %d\n"), getprogname(), SUDOERS_GRAMMAR_VERSION);
                goto done;
            case 'c':
-               checkonly++;            /* check mode */
+               checkonly = true;       /* check mode */
                break;
            case 'f':
                sudoers_path = optarg;  /* sudoers file path */
@@ -198,10 +198,10 @@ main(int argc, char *argv[])
                help();
                break;
            case 's':
-               strict++;               /* strict mode */
+               strict = true;          /* strict mode */
                break;
            case 'q':
-               quiet++;                /* quiet mode */
+               quiet = false;          /* quiet mode */
                break;
            default:
                usage(1);
@@ -235,7 +235,7 @@ main(int argc, char *argv[])
     if ((yyin = open_sudoers(sudoers_path, true, NULL)) == NULL) {
        error(1, "%s", sudoers_path);
     }
-    init_parser(sudoers_path, 0);
+    init_parser(sudoers_path, false);
     yyparse();
     (void) update_defaults(SETDEF_GENERIC|SETDEF_HOST|SETDEF_USER);