[dovecot-cvs] dovecot/src/auth db-passwd-file.c,1.3,1.4
cras at procontrol.fi
cras at procontrol.fi
Thu Feb 20 18:40:18 EET 2003
Update of /home/cvs/dovecot/src/auth
In directory danu:/tmp/cvs-serv7887
Modified Files:
db-passwd-file.c
Log Message:
passwd-file changes. Moved flags before MAIL environment which is now last
so it allows ':' characters in it..
Index: db-passwd-file.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/db-passwd-file.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- db-passwd-file.c 18 Feb 2003 19:11:26 -0000 1.3
+++ db-passwd-file.c 20 Feb 2003 16:40:16 -0000 1.4
@@ -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 @@
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);
}
More information about the dovecot-cvs
mailing list