usermod: report error if homedir does not exist

Report error if usermod asked for moving homedir and it does not exist.

Signed-off-by: Tomáš Mráz <tm@t8m.info>
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
This commit is contained in:
Iker Pedrosa 2022-10-05 15:20:43 +02:00 committed by Serge Hallyn
parent e503fd574b
commit ead03afeba

View File

@ -1882,6 +1882,11 @@ static void move_home (void)
Prog, prefix_user_home, prefix_user_newhome);
fail_exit (E_HOMEDIR);
}
} else {
fprintf (stderr,
_("%s: The previous home directory (%s) does not "
"exist or is inaccessible. Move cannot be completed.\n"),
Prog, prefix_user_home);
}
}