2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-01 06:45:10 +00:00

Sprinkle some more const in defaults.c.

This commit is contained in:
Todd C. Miller
2023-12-15 15:05:02 -07:00
parent 2df637b262
commit f67a7e623e
2 changed files with 12 additions and 12 deletions

View File

@@ -73,7 +73,7 @@ static bool store_timespec(const char *str, struct sudo_defs_types *def);
static bool store_rlimit(const char *str, struct sudo_defs_types *def); static bool store_rlimit(const char *str, struct sudo_defs_types *def);
static bool store_plugin(const char *str, struct sudo_defs_types *def, int op); static bool store_plugin(const char *str, struct sudo_defs_types *def, int op);
static bool list_op(const char *str, size_t, struct list_members *list, enum list_ops op); static bool list_op(const char *str, size_t, struct list_members *list, enum list_ops op);
static bool valid_path(const struct sudoers_context *ctx, struct sudo_defs_types *def, const char *val, const char *file, int line, int column, bool quiet); static bool valid_path(const struct sudoers_context *ctx, const struct sudo_defs_types *def, const char *val, const char *file, int line, int column, bool quiet);
/* /*
* Table describing compile-time and run-time options. * Table describing compile-time and run-time options.
@@ -86,9 +86,9 @@ static bool valid_path(const struct sudoers_context *ctx, struct sudo_defs_types
void void
dump_defaults(void) dump_defaults(void)
{ {
struct sudo_defs_types *cur; const struct sudo_defs_types *cur;
struct list_member *item; const struct list_member *item;
struct def_values *def; const struct def_values *def;
const char *desc; const char *desc;
debug_decl(dump_defaults, SUDOERS_DEBUG_DEFAULTS); debug_decl(dump_defaults, SUDOERS_DEBUG_DEFAULTS);
@@ -695,7 +695,7 @@ oom:
* Returns true if it matches, else false. * Returns true if it matches, else false.
*/ */
static bool static bool
default_type_matches(struct defaults *d, int what) default_type_matches(const struct defaults *d, int what)
{ {
debug_decl(default_type_matches, SUDOERS_DEBUG_DEFAULTS); debug_decl(default_type_matches, SUDOERS_DEBUG_DEFAULTS);
@@ -730,7 +730,7 @@ default_type_matches(struct defaults *d, int what)
*/ */
static bool static bool
default_binding_matches(const struct sudoers_context *ctx, default_binding_matches(const struct sudoers_context *ctx,
struct sudoers_parse_tree *parse_tree, struct defaults *d, int what) struct sudoers_parse_tree *parse_tree, const struct defaults *d, int what)
{ {
debug_decl(default_binding_matches, SUDOERS_DEBUG_DEFAULTS); debug_decl(default_binding_matches, SUDOERS_DEBUG_DEFAULTS);
@@ -764,9 +764,9 @@ default_binding_matches(const struct sudoers_context *ctx,
bool bool
update_defaults(struct sudoers_context *ctx, update_defaults(struct sudoers_context *ctx,
struct sudoers_parse_tree *parse_tree, struct sudoers_parse_tree *parse_tree,
struct defaults_list *defs, int what, bool quiet) const struct defaults_list *defs, int what, bool quiet)
{ {
struct defaults *d; const struct defaults *d;
bool global_defaults = false; bool global_defaults = false;
bool ret = true; bool ret = true;
debug_decl(update_defaults, SUDOERS_DEBUG_DEFAULTS); debug_decl(update_defaults, SUDOERS_DEBUG_DEFAULTS);
@@ -834,7 +834,7 @@ update_defaults(struct sudoers_context *ctx,
bool bool
check_defaults(const struct sudoers_parse_tree *parse_tree, bool quiet) check_defaults(const struct sudoers_parse_tree *parse_tree, bool quiet)
{ {
struct defaults *d; const struct defaults *d;
bool ret = true; bool ret = true;
int idx; int idx;
debug_decl(check_defaults, SUDOERS_DEBUG_DEFAULTS); debug_decl(check_defaults, SUDOERS_DEBUG_DEFAULTS);
@@ -1015,7 +1015,7 @@ store_timespec(const char *str, struct sudo_defs_types *def)
static bool static bool
store_tuple(const char *str, struct sudo_defs_types *def, int op) store_tuple(const char *str, struct sudo_defs_types *def, int op)
{ {
struct def_values *v; const struct def_values *v;
debug_decl(store_tuple, SUDOERS_DEBUG_DEFAULTS); debug_decl(store_tuple, SUDOERS_DEBUG_DEFAULTS);
/* /*
@@ -1177,7 +1177,7 @@ store_timeout(const char *str, struct sudo_defs_types *def)
} }
static bool static bool
valid_path(const struct sudoers_context *ctx, struct sudo_defs_types *def, valid_path(const struct sudoers_context *ctx, const struct sudo_defs_types *def,
const char *val, const char *file, int line, int column, bool quiet) const char *val, const char *file, int line, int column, bool quiet)
{ {
bool ret = true; bool ret = true;

View File

@@ -147,7 +147,7 @@ struct sudoers_parse_tree;
void dump_default(void); void dump_default(void);
bool init_defaults(void); bool init_defaults(void);
bool set_default(struct sudoers_context *ctx, const char *var, const char *val, int op, const char *file, int line, int column, bool quiet); bool set_default(struct sudoers_context *ctx, const char *var, const char *val, int op, const char *file, int line, int column, bool quiet);
bool update_defaults(struct sudoers_context *ctx, struct sudoers_parse_tree *parse_tree, struct defaults_list *defs, int what, bool quiet); bool update_defaults(struct sudoers_context *ctx, struct sudoers_parse_tree *parse_tree, const struct defaults_list *defs, int what, bool quiet);
bool check_defaults(const struct sudoers_parse_tree *parse_tree, bool quiet); bool check_defaults(const struct sudoers_parse_tree *parse_tree, bool quiet);
bool append_default(const char *var, const char *val, int op, char *source, struct defaults_list *defs); bool append_default(const char *var, const char *val, int op, char *source, struct defaults_list *defs);
bool cb_passprompt_regex(struct sudoers_context *ctx, const char *file, int line, int column, const union sudo_defs_val *sd_un, int op); bool cb_passprompt_regex(struct sudoers_context *ctx, const char *file, int line, int column, const union sudo_defs_val *sd_un, int op);