From: nekral-guest Date: Thu, 18 Mar 2010 18:57:03 +0000 (+0000) Subject: * src/useradd.c: When exiting because of a failure, warn if an X-Git-Tag: 4.1.5~305 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e2010a26c5675a76ccb89d3be2f922f2a825de3;p=shadow * src/useradd.c: When exiting because of a failure, warn if an home directory created, but cannot be removed. --- diff --git a/ChangeLog b/ChangeLog index e20922cd..af852475 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-03-18 Nicolas François + + * src/useradd.c: When exiting because of a failure, warn if an + home directory created, but cannot be removed. + 2010-03-18 Nicolas François * libmisc/chowndir.c: Re-indent. diff --git a/src/useradd.c b/src/useradd.c index ee656f7c..31377c5c 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -208,7 +208,12 @@ static void create_mail (void); static void fail_exit (int code) { if (home_added) { - rmdir (user_home); + if (rmdir (user_home) != 0) { + frpintf (stderr, + _("%s: %s was created, but could not be removed\n"), + Prog, user_home); + SYSLOG ((LOG_ERR, "failed to remove %s", user_home)); + } } if (spw_locked) {