* NEWS, src/usermod.c: Check if the user is busy when the user's

UID, name or home directory is changed.
This commit is contained in:
nekral-guest 2009-05-18 18:37:16 +00:00
parent 4a4549c49b
commit b9ecd1cf42
3 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2009-05-18 Nicolas François <nicolas.francois@centraliens.net>
* NEWS, src/usermod.c: Check if the user is busy when the user's
UID, name or home directory is changed.
2009-05-18 Nicolas François <nicolas.francois@centraliens.net> 2009-05-18 Nicolas François <nicolas.francois@centraliens.net>
* src/userdel.c, libmisc/user_busy.c, libmisc/Makefile.am, * src/userdel.c, libmisc/user_busy.c, libmisc/Makefile.am,

3
NEWS
View File

@ -10,6 +10,9 @@ shadow-4.1.4 -> shadow-4.1.4.1 UNRELEASED
the user is running some processes. the user is running some processes.
* If not on Linux, continue to search for an utmp record, but make sure * If not on Linux, continue to search for an utmp record, but make sure
the process recorded in the utmp entry is still running. the process recorded in the utmp entry is still running.
- usermod
* Check if the user is busy when the user's UID, name or home directory
is changed.
shadow-4.1.3.1 -> shadow-4.1.4 2009-05-10 shadow-4.1.3.1 -> shadow-4.1.4 2009-05-10

View File

@ -1715,6 +1715,18 @@ int main (int argc, char **argv)
process_flags (argc, argv); process_flags (argc, argv);
/*
* The home directory, the username and the user's UID should not
* be changed while the user is logged in.
*/
if ( (uflg || lflg || dflg)
&& (user_busy (user_name, user_id) != 0)) {
fprintf (stderr,
_("%s: user %s is currently logged in\n"),
Prog, user_name);
exit (E_USER_BUSY);
}
#ifdef ACCT_TOOLS_SETUID #ifdef ACCT_TOOLS_SETUID
#ifdef USE_PAM #ifdef USE_PAM
{ {