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;
|
rc = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
def->sd_un.flag = op;
|
def->sd_un.flag = (bool)op;
|
||||||
rc = true;
|
rc = true;
|
||||||
break;
|
break;
|
||||||
case T_LIST:
|
case T_LIST:
|
||||||
|
@@ -48,7 +48,7 @@ struct def_values {
|
|||||||
};
|
};
|
||||||
|
|
||||||
union sudo_defs_val {
|
union sudo_defs_val {
|
||||||
int flag;
|
bool flag;
|
||||||
int ival;
|
int ival;
|
||||||
unsigned int uival;
|
unsigned int uival;
|
||||||
enum def_tuple tuple;
|
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 we can't find the editor in the user's PATH, give up. */
|
||||||
if (find_path(editor, &editor_path, &user_editor_sb, getenv("PATH"),
|
if (find_path(editor, &editor_path, &user_editor_sb, getenv("PATH"),
|
||||||
0, allowlist) != FOUND) {
|
false, allowlist) != FOUND) {
|
||||||
errno = ENOENT;
|
errno = ENOENT;
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
|
@@ -87,7 +87,7 @@ cmnd_allowed(char *cmnd, size_t cmnd_size, struct stat *cmnd_sbp,
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
find_path(const char *infile, char **outfile, struct stat *sbp,
|
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];
|
char command[PATH_MAX];
|
||||||
const char *cp, *ep, *pathend;
|
const char *cp, *ep, *pathend;
|
||||||
|
@@ -80,7 +80,7 @@ sudo_dso_public int main(int argc, char *argv[]);
|
|||||||
/* STUB */
|
/* STUB */
|
||||||
int
|
int
|
||||||
find_path(const char *infile, char **outfile, struct stat *sbp,
|
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] == '/') {
|
if (infile[0] == '/') {
|
||||||
*outfile = strdup(infile);
|
*outfile = strdup(infile);
|
||||||
|
@@ -832,7 +832,7 @@ display_privs(struct sudoers_context *ctx, const struct sudo_nss_list *snl,
|
|||||||
/* STUB */
|
/* STUB */
|
||||||
int
|
int
|
||||||
find_path(const char *infile, char **outfile, struct stat *sbp,
|
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) {
|
switch (pass) {
|
||||||
case PASS_CHECK_NOT_FOUND:
|
case PASS_CHECK_NOT_FOUND:
|
||||||
|
@@ -316,7 +316,7 @@ bool sudo_goodpath(const char *path, struct stat *sbp);
|
|||||||
|
|
||||||
/* findpath.c */
|
/* findpath.c */
|
||||||
int find_path(const char *infile, char **outfile, struct stat *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);
|
||||||
|
|
||||||
/* check.c */
|
/* check.c */
|
||||||
int check_user(struct sudoers_context *ctx, unsigned int validated, unsigned int mode);
|
int check_user(struct sudoers_context *ctx, unsigned int validated, unsigned int mode);
|
||||||
|
Reference in New Issue
Block a user