From: nekral-guest Date: Fri, 22 May 2009 10:42:51 +0000 (+0000) Subject: * src/usermod.c: Added warnings for absolute symlinks which could X-Git-Tag: 4.1.4.1~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd55bd5d4abe1292e530e49550dcb7f96ab40eba;p=shadow * src/usermod.c: Added warnings for absolute symlinks which could be broken by rename(). --- diff --git a/ChangeLog b/ChangeLog index 93534fad..4140bcc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-22 Nicolas François + + * src/usermod.c: Added warnings for absolute symlinks which could + be broken by rename(). + 2009-05-22 Nicolas François * NEWS, src/userdel.c: Report errors to remove the user's mailbox. diff --git a/src/usermod.c b/src/usermod.c index c677e8bc..6716aafe 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -1412,6 +1412,9 @@ static void move_home (void) Prog, user_newhome); fail_exit (E_HOMEDIR); } else if (rename (user_home, user_newhome) != 0) { + // FIXME: rename above may have broken symlinks + // pointing to the user's home directory + // with an absolute path. if (errno == EXDEV) { if (mkdir (user_newhome, sb.st_mode & 0777) != 0) { fprintf (stderr,