From: Aki Tuomi Date: Tue, 23 Jan 2024 06:12:50 +0000 (+0200) Subject: lib-storage: Remove %{uid}, %{gid} X-Git-Tag: 2.4.0~1807 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5dba08086405e7d2d96cbceaad4d1d8bd69b6e13;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Remove %{uid}, %{gid} Should use %{process:uid} and %{process:gid} in future. --- diff --git a/src/lib-storage/mail-storage-service.c b/src/lib-storage/mail-storage-service.c index 09bab67f4a..42a34b2187 100644 --- a/src/lib-storage/mail-storage-service.c +++ b/src/lib-storage/mail-storage-service.c @@ -307,15 +307,10 @@ static bool parse_gid(const char *str, gid_t *gid_r, const char **error_r) static const struct var_expand_table * get_var_expand_table(struct master_service *service, struct mail_storage_service_user *user, - const struct mail_storage_service_input *input, - const struct mail_storage_service_privileges *priv) + const struct mail_storage_service_input *input) { const char *username = t_strcut(input->username, '@'); const char *domain = i_strchr_to_next(input->username, '@'); - const char *uid = priv == NULL ? NULL : - dec2str(priv->uid == (uid_t)-1 ? geteuid() : priv->uid); - const char *gid = priv == NULL ? NULL : - dec2str(priv->gid == (gid_t)-1 ? getegid() : priv->gid); const char *local_name = NULL; const char *auth_user, *auth_username, *auth_domain; @@ -341,8 +336,6 @@ get_var_expand_table(struct master_service *service, { 's', service_name, "service" }, { 'l', net_ip2addr(&input->local_ip), "lip" }, { 'r', net_ip2addr(&input->remote_ip), "rip" }, - { 'i', uid, "uid" }, - { '\0', gid, "gid" }, { '\0', input->session_id, "session" }, { '\0', auth_user, "auth_user" }, { '\0', auth_username, "auth_username" }, @@ -365,12 +358,7 @@ const struct var_expand_table * mail_storage_service_get_var_expand_table(struct mail_storage_service_ctx *ctx, struct mail_storage_service_input *input) { - struct mail_storage_service_privileges priv; - - i_zero(&priv); - priv.uid = (uid_t)-1; - priv.gid = (gid_t)-1; - return get_var_expand_table(ctx->service, NULL, input, &priv); + return get_var_expand_table(ctx->service, NULL, input); } static int @@ -744,7 +732,7 @@ mail_storage_service_var_expand_callback(struct event *event, *tab_r = get_var_expand_table(var_expand_ctx->ctx->service, var_expand_ctx->user, - var_expand_ctx->input, NULL); + var_expand_ctx->input); *func_tab_r = mail_storage_service_var_expand_func_table; } diff --git a/src/lib-storage/mail-user.c b/src/lib-storage/mail-user.c index 301c46a889..47b9f321c7 100644 --- a/src/lib-storage/mail-user.c +++ b/src/lib-storage/mail-user.c @@ -307,8 +307,6 @@ mail_user_var_expand_table(struct mail_user *user) { 's', user->service, "service" }, { 'l', local_ip, "lip" }, { 'r', remote_ip, "rip" }, - { 'i', p_strdup(user->pool, dec2str(user->uid)), "uid" }, - { '\0', p_strdup(user->pool, dec2str(user->gid)), "gid" }, { '\0', user->session_id, "session" }, { '\0', auth_user, "auth_user" }, { '\0', auth_username, "auth_username" },