Dovecot is faulting on an error about permissions that it shouldn't do. I've got an user with its home dir with permissions 700, and inside the mail directory with the mboxes. In the error log I can see: 'Can't chdir to /home/user. Permission denied' I wonder why it has to chdir to that directory and why it can't access. Shouldn't it be running as the user?
On Friday, Jul 11, 2003, at 11:18 Europe/Helsinki, Jaime Medrano wrote:> Dovecot is faulting on an error about permissions that it shouldn't do. > > I've got an user with its home dir with permissions 700, and inside the > mail directory with the mboxes. > In the error log I can see: 'Can't chdir to /home/user. Permission > denied' > > I wonder why it has to chdir to that directory and why it can't access. > Shouldn't it be running as the user?What is the exact error message? The only chdir() calls that I see are done as root, so there shouldn't be any permission problems. Or if the above is an exact message from log, it's not created by Dovecot.
On Saturday, Jul 12, 2003, at 11:13 Europe/Helsinki, Jaime Medrano wrote:> That's the problem. The home dir is exported by nfs. Chdirs should be > done as the user, not as root.Right.. Well, I'll just ignore that error then: Index: mail-process.c ==================================================================RCS file: /home/cvs/dovecot/src/master/mail-process.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- mail-process.c 10 Jul 2003 03:04:07 -0000 1.25 +++ mail-process.c 12 Jul 2003 15:45:19 -0000 1.26 @@ -168,7 +168,9 @@ if (*home_dir != '\0') { full_home_dir = *chroot_dir == '\0' ? home_dir : t_strconcat(chroot_dir, "/", home_dir, NULL); - if (chdir(full_home_dir) < 0) + /* NOTE: if home directory is NFS-mounted, we might not + have access to it as root. Ignore such errors. */ + if (chdir(full_home_dir) < 0 && errno != EACCES) i_fatal("chdir(%s) failed: %m", full_home_dir); }