]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
More realm fixes
authorTimo Sirainen <tss@iki.fi>
Sun, 9 Feb 2003 17:23:20 +0000 (19:23 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 9 Feb 2003 17:23:20 +0000 (19:23 +0200)
--HG--
branch : HEAD

src/auth/db-passwd-file.c
src/login-common/auth-common.c

index 346e7b74e2d81f265e458aea85f716b330a921b9..389582fb9b367627d44161029510dda74251f5bb 100644 (file)
@@ -34,6 +34,10 @@ static void passwd_file_add(struct passwd_file *pw, const char *username,
        pu = p_new(pw->pool, struct passwd_user, 1);
        pu->user_realm = p_strdup(pw->pool, username);
 
+       pu->realm = strchr(pu->user_realm, '@');
+       if (pu->realm != NULL)
+               pu->realm++;
+
        p = pass == NULL ? NULL : strchr(pass, '[');
        if (p == NULL) {
                pu->password = p_strdup(pw->pool, pass);
index 942b8b3674f588ff7ec02f59c5fca2590b872af4..6ac69a1e7bc97bdf3ae68b9fc70a05fdfc1be4b9 100644 (file)
@@ -17,7 +17,7 @@ static const char *auth_login_get_str(struct auth_login_reply *reply,
        stop = reply->reply_idx < reply->data_size ?
                reply->reply_idx-1 : reply->data_size;
 
-       return t_strndup(data, stop);
+       return t_strndup(data + idx, stop);
 }
 
 int auth_callback(struct auth_request *request, struct auth_login_reply *reply,