The second argument to init_parser() is now bool.

This commit is contained in:
Todd C. Miller
2012-08-02 15:40:11 -04:00
parent 80597710c1
commit 355d40aa86
6 changed files with 10 additions and 10 deletions

View 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;

View 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;

View 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) {

View 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 */

View 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;

View 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);