From ead03afeba68310de778547c8b384d086ce802d0 Mon Sep 17 00:00:00 2001 From: Iker Pedrosa Date: Wed, 5 Oct 2022 15:20:43 +0200 Subject: [PATCH] usermod: report error if homedir does not exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Report error if usermod asked for moving homedir and it does not exist. Signed-off-by: Tomáš Mráz Signed-off-by: Iker Pedrosa --- src/usermod.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/usermod.c b/src/usermod.c index 44e056ae..e51f48a3 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -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); } }