From: Bastian Blank Date: Tue, 17 Nov 2015 16:52:24 +0000 (-0600) Subject: Fix user busy errors at userdel X-Git-Tag: 4.3.0~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2fa8c5d4b0b19445562daf78d3a62421fe8d6b8;p=shadow Fix user busy errors at userdel From: Bastian Blank Acked-by: Serge Hallyn --- diff --git a/libmisc/user_busy.c b/libmisc/user_busy.c index db7174af..0db32c39 100644 --- a/libmisc/user_busy.c +++ b/libmisc/user_busy.c @@ -175,6 +175,9 @@ static int user_busy_processes (const char *name, uid_t uid) if (stat ("/", &sbroot) != 0) { perror ("stat (\"/\")"); (void) closedir (proc); +#ifdef ENABLE_SUBIDS + sub_uid_close(); +#endif return 0; } @@ -212,6 +215,9 @@ static int user_busy_processes (const char *name, uid_t uid) if (check_status (name, tmp_d_name, uid) != 0) { (void) closedir (proc); +#ifdef ENABLE_SUBIDS + sub_uid_close(); +#endif fprintf (stderr, _("%s: user %s is currently used by process %d\n"), Prog, name, pid); @@ -232,6 +238,9 @@ static int user_busy_processes (const char *name, uid_t uid) } if (check_status (name, task_path+6, uid) != 0) { (void) closedir (proc); +#ifdef ENABLE_SUBIDS + sub_uid_close(); +#endif fprintf (stderr, _("%s: user %s is currently used by process %d\n"), Prog, name, pid);