]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: passwd-file - Make all pointers in struct passwd_user const
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 26 Feb 2024 12:42:36 +0000 (14:42 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:39:58 +0000 (10:39 +0200)
src/auth/db-passwd-file.c
src/auth/db-passwd-file.h
src/auth/passdb-passwd-file.c
src/auth/userdb-passwd-file.c

index fa5c0018f128c5a472ec3aea318c75250f0f21b8..1df960f16cfb673f0cf4f4741c067f263c7329c5 100644 (file)
@@ -162,8 +162,8 @@ passwd_file_add(struct passwd_file *pw, const char *username,
         }
 
         if (extra_fields != NULL) {
-                pu->extra_fields =
-                        p_strsplit_spaces(pw->pool, extra_fields, " ");
+               pu->extra_fields = (const char *const *)
+                       p_strsplit_spaces(pw->pool, extra_fields, " ");
         }
 
        hash_table_insert(pw->users, user, pu);
index 07235e830742604c297257cc36ff90379d6ee8b4..7ef8b3b4dc48d07c6e0f60ce4b01887bafc79f9e 100644 (file)
@@ -7,9 +7,9 @@ struct passwd_user {
        uid_t uid;
        gid_t gid;
 
-       char *home;
-        char *password;
-        char **extra_fields;
+       const char *home;
+       const char *password;
+       const char *const *extra_fields;
 };
 
 struct passwd_file {
index 97d959b1d5b61989ceb06f129ed0b97d4216ed89..ec003aef2c8b2c15805b1b29d97c8057fde9b4ac 100644 (file)
@@ -18,7 +18,8 @@ struct passwd_file_passdb_module {
 };
 
 static int
-passwd_file_add_extra_fields(struct auth_request *request, char *const *fields)
+passwd_file_add_extra_fields(struct auth_request *request,
+                            const char *const *fields)
 {
        string_t *str = t_str_new(512);
         const struct var_expand_table *table;
index f9ff16450d9ab587fa101c48ce02462e06da5418..0c4a5bbc19c0c966a2ea487961d97f90d415e9d4 100644 (file)
@@ -28,7 +28,8 @@ struct passwd_file_userdb_module {
 };
 
 static int
-passwd_file_add_extra_fields(struct auth_request *request, char *const *fields)
+passwd_file_add_extra_fields(struct auth_request *request,
+                            const char *const *fields)
 {
        string_t *str = t_str_new(512);
         const struct var_expand_table *table;