From: Tomas Mraz Date: Tue, 15 Nov 2016 15:00:51 +0000 (+0100) Subject: Print error message if SELinux file context manipulation fails. X-Git-Tag: 4.5~31^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=765993846d110820a6bc7992a1cbfeeafefdc906;p=shadow Print error message if SELinux file context manipulation fails. --- diff --git a/src/useradd.c b/src/useradd.c index 6c43e7e3..95e8ee7e 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -1896,6 +1896,9 @@ static void create_home (void) if (access (user_home, F_OK) != 0) { #ifdef WITH_SELINUX if (set_selinux_file_context (user_home) != 0) { + fprintf (stderr, + _("%s: cannot set SELinux context for home directory %s\n"), + Prog, user_home); fail_exit (E_HOMEDIR); } #endif @@ -1925,6 +1928,9 @@ static void create_home (void) #ifdef WITH_SELINUX /* Reset SELinux to create files with default contexts */ if (reset_selinux_file_context () != 0) { + fprintf (stderr, + _("%s: cannot reset SELinux file creation context\n"), + Prog); fail_exit (E_HOMEDIR); } #endif