* src/usermod.c: Added warnings for absolute symlinks which could

be broken by rename().
This commit is contained in:
nekral-guest 2009-05-22 10:42:51 +00:00
parent 604c7d72d9
commit fd55bd5d4a
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2009-05-22 Nicolas François <nicolas.francois@centraliens.net>
* src/usermod.c: Added warnings for absolute symlinks which could
be broken by rename().
2009-05-22 Nicolas François <nicolas.francois@centraliens.net> 2009-05-22 Nicolas François <nicolas.francois@centraliens.net>
* NEWS, src/userdel.c: Report errors to remove the user's mailbox. * NEWS, src/userdel.c: Report errors to remove the user's mailbox.

View File

@ -1412,6 +1412,9 @@ static void move_home (void)
Prog, user_newhome); Prog, user_newhome);
fail_exit (E_HOMEDIR); fail_exit (E_HOMEDIR);
} else if (rename (user_home, user_newhome) != 0) { } 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 (errno == EXDEV) {
if (mkdir (user_newhome, sb.st_mode & 0777) != 0) { if (mkdir (user_newhome, sb.st_mode & 0777) != 0) {
fprintf (stderr, fprintf (stderr,