Make flag in union sudo_defs_val bool to match how it is used.

Adjust find_path()'s ignore_dot function argument to match.
This commit is contained in:
Todd C. Miller
2023-09-13 14:59:29 -06:00
parent a9801cc99d
commit b8f2680cf0
7 changed files with 7 additions and 7 deletions

View File

@@ -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:

View File

@@ -48,7 +48,7 @@ struct def_values {
};
union sudo_defs_val {
int flag;
bool flag;
int ival;
unsigned int uival;
enum def_tuple tuple;

View File

@@ -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;
}

View File

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

View File

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

View File

@@ -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:

View File

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