13 Jul
2003
13 Jul
'03
12:58 a.m.
Timo Sirainen tss@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