[dovecot-cvs] dovecot/src/auth db-passwd-file.c,1.29,1.30
tss at dovecot.org
tss at dovecot.org
Sun Mar 11 23:03:17 EET 2007
Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv10763
Modified Files:
db-passwd-file.c
Log Message:
If passwd-file wasn't found, don't crash.
Index: db-passwd-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-passwd-file.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- db-passwd-file.c 10 Mar 2007 13:24:15 -0000 1.29
+++ db-passwd-file.c 11 Mar 2007 21:03:15 -0000 1.30
@@ -242,7 +242,8 @@
if (errno != ENOENT)
i_error("passwd-file %s: stat() failed: %m", pw->path);
- passwd_file_free(pw);
+ if (pw->db->default_file != pw)
+ passwd_file_free(pw);
return FALSE;
}
@@ -389,7 +390,7 @@
{
struct passwd_file *pw;
struct passwd_user *pu;
- const char *username;
+ const char *username, *path;
if (!db->vars)
pw = db->default_file;
@@ -412,13 +413,16 @@
t_pop();
}
+ t_push();
+ path = t_strdup(pw->path);
if (!passwd_file_sync(pw)) {
+ /* pw may be freed now */
auth_request_log_info(request, "passwd-file",
- "no passwd file: %s", pw->path);
+ "no passwd file: %s", path);
+ t_pop();
return NULL;
}
- t_push();
username = !db->domain_var ? request->user :
t_strcut(request->user, '@');
More information about the dovecot-cvs
mailing list