diff --git a/plugins/sudoers/defaults.c b/plugins/sudoers/defaults.c index 925939a31..c4dd4fb07 100644 --- a/plugins/sudoers/defaults.c +++ b/plugins/sudoers/defaults.c @@ -278,7 +278,7 @@ parse_default_entry(const struct sudoers_context *ctx, rc = -1; break; } - def->sd_un.flag = op; + def->sd_un.flag = (bool)op; rc = true; break; case T_LIST: diff --git a/plugins/sudoers/defaults.h b/plugins/sudoers/defaults.h index 351bc093b..3b30cd0c6 100644 --- a/plugins/sudoers/defaults.h +++ b/plugins/sudoers/defaults.h @@ -48,7 +48,7 @@ struct def_values { }; union sudo_defs_val { - int flag; + bool flag; int ival; unsigned int uival; enum def_tuple tuple; diff --git a/plugins/sudoers/editor.c b/plugins/sudoers/editor.c index 424c4aeda..ce69eb37f 100644 --- a/plugins/sudoers/editor.c +++ b/plugins/sudoers/editor.c @@ -148,7 +148,7 @@ resolve_editor(const char *ed, size_t edlen, int nfiles, char * const *files, /* If we can't find the editor in the user's PATH, give up. */ if (find_path(editor, &editor_path, &user_editor_sb, getenv("PATH"), - 0, allowlist) != FOUND) { + false, allowlist) != FOUND) { errno = ENOENT; goto bad; } diff --git a/plugins/sudoers/find_path.c b/plugins/sudoers/find_path.c index 793ee6a2b..51e2a5c28 100644 --- a/plugins/sudoers/find_path.c +++ b/plugins/sudoers/find_path.c @@ -87,7 +87,7 @@ cmnd_allowed(char *cmnd, size_t cmnd_size, struct stat *cmnd_sbp, */ int find_path(const char *infile, char **outfile, struct stat *sbp, - const char *path, int ignore_dot, char * const *allowlist) + const char *path, bool ignore_dot, char * const *allowlist) { char command[PATH_MAX]; const char *cp, *ep, *pathend; diff --git a/plugins/sudoers/regress/editor/check_editor.c b/plugins/sudoers/regress/editor/check_editor.c index 0ebbd58e5..8360a91c1 100644 --- a/plugins/sudoers/regress/editor/check_editor.c +++ b/plugins/sudoers/regress/editor/check_editor.c @@ -80,7 +80,7 @@ sudo_dso_public int main(int argc, char *argv[]); /* STUB */ int find_path(const char *infile, char **outfile, struct stat *sbp, - const char *path, int ignore_dot, char * const *allowlist) + const char *path, bool ignore_dot, char * const *allowlist) { if (infile[0] == '/') { *outfile = strdup(infile); diff --git a/plugins/sudoers/regress/fuzz/fuzz_policy.c b/plugins/sudoers/regress/fuzz/fuzz_policy.c index d0e978e06..243776d87 100644 --- a/plugins/sudoers/regress/fuzz/fuzz_policy.c +++ b/plugins/sudoers/regress/fuzz/fuzz_policy.c @@ -832,7 +832,7 @@ display_privs(struct sudoers_context *ctx, const struct sudo_nss_list *snl, /* STUB */ int find_path(const char *infile, char **outfile, struct stat *sbp, - const char *path, int ignore_dot, char * const *allowlist) + const char *path, bool ignore_dot, char * const *allowlist) { switch (pass) { case PASS_CHECK_NOT_FOUND: diff --git a/plugins/sudoers/sudoers.h b/plugins/sudoers/sudoers.h index 1ea67bc60..8de6f8e0b 100644 --- a/plugins/sudoers/sudoers.h +++ b/plugins/sudoers/sudoers.h @@ -316,7 +316,7 @@ bool sudo_goodpath(const char *path, struct stat *sbp); /* findpath.c */ int find_path(const char *infile, char **outfile, struct stat *sbp, - const char *path, int ignore_dot, char * const *allowlist); + const char *path, bool ignore_dot, char * const *allowlist); /* check.c */ int check_user(struct sudoers_context *ctx, unsigned int validated, unsigned int mode);