[Dovecot] Permission denied

Matthias Andree matthias.andree at gmx.de
Sun Jul 13 00:58:45 EEST 2003


Timo Sirainen <tss at iki.fi> writes:

> 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:

What if the home directory is owned by another user rather than the real
owner? You won't detect that condition any more with the patch.

How about this scheme (pseudo code):

seteuid(uid);
ret = chdir(targetdir);
seteuid(0);
if (ret == -1) {
 /* handle error */
}

Make sure you don't add ANY branches between the seteuid() calls, no
mistakes must happen there.

-- 
Matthias Andree


More information about the dovecot mailing list