diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2024-02-22 17:04:15 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2024-02-22 16:04:15 +0000 |
commit | dc370deab4752c264c20e16684d02692532c351b (patch) | |
tree | 5508495ee1479f6c2b07991dd6c216732ed1a22c | |
parent | bcc3b81b920491fa9ec94e3fc584cf7384e8380d (diff) | |
download | pam-dc370deab4752c264c20e16684d02692532c351b.tar.gz pam-dc370deab4752c264c20e16684d02692532c351b.tar.bz2 pam-dc370deab4752c264c20e16684d02692532c351b.zip |
conf/modules: constify read-only data arrays
-rw-r--r-- | conf/pam_conv1/pam_conv_y.y | 2 | ||||
-rw-r--r-- | modules/pam_ftp/pam_ftp.c | 2 | ||||
-rw-r--r-- | modules/pam_limits/pam_limits.c | 4 | ||||
-rw-r--r-- | modules/pam_namespace/pam_namespace.c | 8 |
4 files changed, 8 insertions, 8 deletions
diff --git a/conf/pam_conv1/pam_conv_y.y b/conf/pam_conv1/pam_conv_y.y index e2cf85c3..a800cebc 100644 --- a/conf/pam_conv1/pam_conv_y.y +++ b/conf/pam_conv1/pam_conv_y.y @@ -178,7 +178,7 @@ tok const char *old_to_new_ctrl_flag(const char *old) { - static const char *clist[] = { + static const char *const clist[] = { "requisite", "required", "sufficient", diff --git a/modules/pam_ftp/pam_ftp.c b/modules/pam_ftp/pam_ftp.c index 41fb9f48..cfb0f177 100644 --- a/modules/pam_ftp/pam_ftp.c +++ b/modules/pam_ftp/pam_ftp.c @@ -84,7 +84,7 @@ static int lookup(const char *name, const char *list, char **_user) } } else { #define MAX_L 2 - static const char *l[MAX_L] = { "ftp", "anonymous" }; + static const char *const l[MAX_L] = { "ftp", "anonymous" }; int i; for (i=0; i<MAX_L; ++i) { diff --git a/modules/pam_limits/pam_limits.c b/modules/pam_limits/pam_limits.c index 89d03f8a..59cd1f3c 100644 --- a/modules/pam_limits/pam_limits.c +++ b/modules/pam_limits/pam_limits.c @@ -68,7 +68,7 @@ #define LIMIT_RANGE_MIN 2 /* only minimum uid/gid specified (min_uid:) */ #define LIMIT_RANGE_MM 3 /* both min and max uid/gid specified (min_uid:max_uid) */ -static const char *limits_def_names[] = { +static const char *const limits_def_names[] = { "USER", "GROUP", "ALLGROUP", @@ -323,7 +323,7 @@ check_logins (pam_handle_t *pamh, const char *name, int limit, int ctrl, } #ifdef __linux__ -static const char *lnames[RLIM_NLIMITS] = { +static const char *const lnames[RLIM_NLIMITS] = { [RLIMIT_CPU] = "Max cpu time", [RLIMIT_FSIZE] = "Max file size", [RLIMIT_DATA] = "Max data size", diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c index b16731c2..e499d95a 100644 --- a/modules/pam_namespace/pam_namespace.c +++ b/modules/pam_namespace/pam_namespace.c @@ -206,7 +206,7 @@ static void cleanup_protect_data(pam_handle_t *pamh UNUSED , void *data, int err unprotect_dirs(data); } -static char *expand_variables(const char *orig, const char *var_names[], const char *var_values[]) +static char *expand_variables(const char *orig, const char *const var_names[], const char *var_values[]) { const char *src = orig; char *dst; @@ -402,9 +402,9 @@ static int parse_method(char *method, struct polydir_s *poly, { enum polymethod pm; char *sptr = NULL; - static const char *method_names[] = { "user", "context", "level", "tmpdir", + static const char *const method_names[] = { "user", "context", "level", "tmpdir", "tmpfs", NULL }; - static const char *flag_names[] = { "create", "noinit", "iscript", + static const char *const flag_names[] = { "create", "noinit", "iscript", "shared", "mntopts", NULL }; static const unsigned int flag_values[] = { POLYDIR_CREATE, POLYDIR_NOINIT, POLYDIR_ISCRIPT, POLYDIR_SHARED, POLYDIR_MNTOPTS }; @@ -487,7 +487,7 @@ static int process_line(char *line, const char *home, const char *rhome, struct polydir_s *poly; int retval = 0; char **config_options = NULL; - static const char *var_names[] = {"HOME", "USER", NULL}; + static const char *const var_names[] = {"HOME", "USER", NULL}; const char *var_values[] = {home, idata->user}; const char *rvar_values[] = {rhome, idata->ruser}; size_t len; |