]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
passwd-file changes. Moved flags before MAIL environment which is now last
authorTimo Sirainen <tss@iki.fi>
Thu, 20 Feb 2003 16:40:16 +0000 (18:40 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 20 Feb 2003 16:40:16 +0000 (18:40 +0200)
so it allows ':' characters in it..

--HG--
branch : HEAD

src/auth/db-passwd-file.c

index 07af1b57778278e24e6cf0f08b76857bfe1f9c9b..6c12e8195f4799693d07ef5d581626cadac19ee5 100644 (file)
@@ -12,6 +12,7 @@
 #include "buffer.h"
 #include "istream.h"
 #include "hash.h"
+#include "str.h"
 
 #include <stdlib.h>
 #include <unistd.h>
@@ -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);
 }