From 6f3477f300e07171c09807d352ace4282dd41c98 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 20 Feb 2003 18:40:16 +0200 Subject: [PATCH] passwd-file changes. Moved flags before MAIL environment which is now last so it allows ':' characters in it.. --HG-- branch : HEAD --- src/auth/db-passwd-file.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/auth/db-passwd-file.c b/src/auth/db-passwd-file.c index 07af1b5777..6c12e8195f 100644 --- a/src/auth/db-passwd-file.c +++ b/src/auth/db-passwd-file.c @@ -12,6 +12,7 @@ #include "buffer.h" #include "istream.h" #include "hash.h" +#include "str.h" #include #include @@ -21,7 +22,7 @@ static void passwd_file_add(struct passwd_file *pw, const char *username, const char *pass, const char *const *args) { - /* args = uid, gid, user info, home dir, shell, mail, chroot */ + /* args = uid, gid, user info, home dir, shell, flags, mail */ struct passwd_user *pu; const char *p; @@ -97,15 +98,23 @@ static void passwd_file_add(struct passwd_file *pw, const char *username, if (*args != NULL) args++; - /* mail storage */ + /* flags */ + if (*args != NULL && strstr(*args, "chroot") != NULL) + pu->chroot = TRUE; + + /* rest is MAIL environment */ if (*args != NULL) { - pu->mail = p_strdup(pw->pool, *args); + string_t *str = t_str_new(100); + str_append(str, *args); args++; - } - /* chroot */ - if (*args != NULL && strstr(*args, "chroot") != NULL) - pu->chroot = TRUE; + while (*args != NULL) { + str_append_c(str, ':'); + str_append(str, *args); + args++; + } + pu->mail = p_strdup(pw->pool, str_c(str)); + } hash_insert(pw->users, pu->user_realm, pu); } -- 2.47.3