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: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e2010a26c5675a76ccb89d3be2f922f2a825de3;p=thirdparty%2Fshadow.git * 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 e20922cdb..af852475e 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 ee656f7c8..31377c5c0 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) {