From: Timo Sirainen Date: Mon, 26 Feb 2024 12:42:36 +0000 (+0200) Subject: auth: passwd-file - Make all pointers in struct passwd_user const X-Git-Tag: 2.4.1~1027 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=166a47eea8753b6b80e6642aa233e4eaf8175093;p=thirdparty%2Fdovecot%2Fcore.git auth: passwd-file - Make all pointers in struct passwd_user const --- diff --git a/src/auth/db-passwd-file.c b/src/auth/db-passwd-file.c index fa5c0018f1..1df960f16c 100644 --- a/src/auth/db-passwd-file.c +++ b/src/auth/db-passwd-file.c @@ -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); diff --git a/src/auth/db-passwd-file.h b/src/auth/db-passwd-file.h index 07235e8307..7ef8b3b4dc 100644 --- a/src/auth/db-passwd-file.h +++ b/src/auth/db-passwd-file.h @@ -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 { diff --git a/src/auth/passdb-passwd-file.c b/src/auth/passdb-passwd-file.c index 97d959b1d5..ec003aef2c 100644 --- a/src/auth/passdb-passwd-file.c +++ b/src/auth/passdb-passwd-file.c @@ -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; diff --git a/src/auth/userdb-passwd-file.c b/src/auth/userdb-passwd-file.c index f9ff16450d..0c4a5bbc19 100644 --- a/src/auth/userdb-passwd-file.c +++ b/src/auth/userdb-passwd-file.c @@ -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;