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:
@@ -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:
|
||||
|
@@ -48,7 +48,7 @@ struct def_values {
|
||||
};
|
||||
|
||||
union sudo_defs_val {
|
||||
int flag;
|
||||
bool flag;
|
||||
int ival;
|
||||
unsigned int uival;
|
||||
enum def_tuple tuple;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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:
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user