[dovecot-cvs] dovecot/src/master auth-process.c,1.43,1.44 mail-process.c,1.15,1.16
cras at procontrol.fi
cras at procontrol.fi
Thu May 8 08:28:33 EEST 2003
- Previous message: [dovecot-cvs] dovecot/doc auth.txt,1.8,1.9 dovecot-ldap.conf,1.5,1.6 dovecot-pgsql.conf,1.3,1.4
- Next message: [dovecot-cvs] dovecot/src/auth auth-master-interface.h,1.1,1.2 db-passwd-file.c,1.7,1.8 db-passwd-file.h,1.3,1.4 master-connection.c,1.6,1.7 userdb-ldap.c,1.10,1.11 userdb-passwd-file.c,1.5,1.6 userdb-passwd.c,1.5,1.6 userdb-pgsql.c,1.3,1.4 userdb.h,1.6,1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/master
In directory danu:/tmp/cvs-serv3042/src/master
Modified Files:
auth-process.c mail-process.c
Log Message:
Chrooting changes. Now all userdbs will support "<chroot>/./<homedir>" style
home directories.
Index: auth-process.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/auth-process.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- auth-process.c 8 May 2003 04:01:51 -0000 1.43
+++ auth-process.c 8 May 2003 04:28:30 -0000 1.44
@@ -90,6 +90,8 @@
reply->virtual_user_idx = nul_pos;
if (reply->home_idx >= reply->data_size)
reply->home_idx = nul_pos;
+ if (reply->chroot_idx >= reply->data_size)
+ reply->chroot_idx = nul_pos;
if (reply->mail_idx >= reply->data_size)
reply->mail_idx = nul_pos;
Index: mail-process.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/mail-process.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- mail-process.c 8 May 2003 03:35:48 -0000 1.15
+++ mail-process.c 8 May 2003 04:28:30 -0000 1.16
@@ -105,7 +105,7 @@
const char *data)
{
static const char *argv[] = { NULL, NULL, NULL };
- const char *host, *mail, *home_dir;
+ const char *host, *mail, *chroot_dir, *home_dir, *full_home_dir;
char title[1024];
pid_t pid;
int i, err;
@@ -118,8 +118,11 @@
if (!validate_uid_gid(reply->uid, reply->gid))
return FALSE;
- if (reply->chroot && !validate_chroot(data + reply->home_idx)) {
- i_error("Invalid chroot directory: %s", data + reply->home_idx);
+ home_dir = data + reply->home_idx;
+ chroot_dir = data + reply->chroot_idx;
+
+ if (*chroot_dir != '\0' && validate_chroot(chroot_dir)) {
+ i_error("Invalid chroot directory: %s", chroot_dir);
return FALSE;
}
@@ -151,15 +154,15 @@
/* setup environment - set the most important environment first
(paranoia about filling up environment without noticing) */
restrict_access_set_env(data + reply->system_user_idx,
- reply->uid, reply->gid,
- reply->chroot ? data + reply->home_idx : NULL);
+ reply->uid, reply->gid, chroot_dir);
restrict_process_size(process_size, (unsigned int)-1);
- home_dir = data + reply->home_idx;
if (*home_dir != '\0') {
- if (chdir(home_dir) < 0)
- i_fatal("chdir(%s) failed: %m", home_dir);
+ full_home_dir = *chroot_dir == '\0' ? home_dir :
+ t_strconcat(chroot_dir, "/", home_dir, NULL);
+ if (chdir(full_home_dir) < 0)
+ i_fatal("chdir(%s) failed: %m", full_home_dir);
}
env_put("LOGGED_IN=1");
@@ -204,7 +207,7 @@
if (*mail == '\0' && set->default_mail_env != NULL) {
mail = expand_mail_env(set->default_mail_env,
data + reply->virtual_user_idx,
- data + reply->home_idx);
+ home_dir);
}
env_put(t_strconcat("MAIL=", mail, NULL));
- Previous message: [dovecot-cvs] dovecot/doc auth.txt,1.8,1.9 dovecot-ldap.conf,1.5,1.6 dovecot-pgsql.conf,1.3,1.4
- Next message: [dovecot-cvs] dovecot/src/auth auth-master-interface.h,1.1,1.2 db-passwd-file.c,1.7,1.8 db-passwd-file.h,1.3,1.4 master-connection.c,1.6,1.7 userdb-ldap.c,1.10,1.11 userdb-passwd-file.c,1.5,1.6 userdb-passwd.c,1.5,1.6 userdb-pgsql.c,1.3,1.4 userdb.h,1.6,1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list