From: Todd C. Miller Date: Thu, 2 Aug 2012 19:40:11 +0000 (-0400) Subject: The second argument to init_parser() is now bool. X-Git-Tag: SUDO_1_8_6^2~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=355d40aa862242b07c227bd82a02dd88136ba264;p=sudo The second argument to init_parser() is now bool. --- diff --git a/plugins/sudoers/gram.c b/plugins/sudoers/gram.c index b4b40871d..2ce2a9c6d 100644 --- a/plugins/sudoers/gram.c +++ b/plugins/sudoers/gram.c @@ -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; diff --git a/plugins/sudoers/gram.y b/plugins/sudoers/gram.y index b85141b44..71f5b172b 100644 --- a/plugins/sudoers/gram.y +++ b/plugins/sudoers/gram.y @@ -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; diff --git a/plugins/sudoers/parse.c b/plugins/sudoers/parse.c index 3468a8e30..1d37a0342 100644 --- a/plugins/sudoers/parse.c +++ b/plugins/sudoers/parse.c @@ -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) { diff --git a/plugins/sudoers/parse.h b/plugins/sudoers/parse.h index 0c4a4d7fc..3f7c451ae 100644 --- a/plugins/sudoers/parse.h +++ b/plugins/sudoers/parse.h @@ -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 */ diff --git a/plugins/sudoers/testsudoers.c b/plugins/sudoers/testsudoers.c index f0c84fc26..576458c1a 100644 --- a/plugins/sudoers/testsudoers.c +++ b/plugins/sudoers/testsudoers.c @@ -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; diff --git a/plugins/sudoers/visudo.c b/plugins/sudoers/visudo.c index 8175b6efc..284c454be 100644 --- a/plugins/sudoers/visudo.c +++ b/plugins/sudoers/visudo.c @@ -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);