2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +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_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 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.
@@ -86,9 +86,9 @@ static bool valid_path(const struct sudoers_context *ctx, struct sudo_defs_types
void
dump_defaults(void)
{
struct sudo_defs_types *cur;
struct list_member *item;
struct def_values *def;
const struct sudo_defs_types *cur;
const struct list_member *item;
const struct def_values *def;
const char *desc;
debug_decl(dump_defaults, SUDOERS_DEBUG_DEFAULTS);
@@ -695,7 +695,7 @@ oom:
* Returns true if it matches, else false.
*/
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);
@@ -730,7 +730,7 @@ default_type_matches(struct defaults *d, int what)
*/
static bool
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);
@@ -764,9 +764,9 @@ default_binding_matches(const struct sudoers_context *ctx,
bool
update_defaults(struct sudoers_context *ctx,
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 ret = true;
debug_decl(update_defaults, SUDOERS_DEBUG_DEFAULTS);
@@ -834,7 +834,7 @@ update_defaults(struct sudoers_context *ctx,
bool
check_defaults(const struct sudoers_parse_tree *parse_tree, bool quiet)
{
struct defaults *d;
const struct defaults *d;
bool ret = true;
int idx;
debug_decl(check_defaults, SUDOERS_DEBUG_DEFAULTS);
@@ -1015,7 +1015,7 @@ store_timespec(const char *str, struct sudo_defs_types *def)
static bool
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);
/*
@@ -1177,7 +1177,7 @@ store_timeout(const char *str, struct sudo_defs_types *def)
}
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)
{
bool ret = true;