* NEWS, src/userdel.c: Fixed SE Linux support. semanage should be

called at the end.
	* src/useradd.c: Always call selinux_update_mapping() (i.e.
	semanage), not only when -Z is used.
This commit is contained in:
nekral-guest
2009-04-15 21:14:08 +00:00
parent a24058d660
commit 4d2bee2e23
4 changed files with 24 additions and 16 deletions

View File

@ -2010,9 +2010,7 @@ int main (int argc, char **argv)
close_files ();
#ifdef WITH_SELINUX
if (Zflg) {
selinux_update_mapping ();
}
selinux_update_mapping ();
#endif
nscd_flush_cache ("passwd");

View File

@ -797,17 +797,6 @@ int main (int argc, char **argv)
audit_help_open ();
#endif
#ifdef WITH_SELINUX
if (is_selinux_enabled () > 0) {
const char *args[5];
args[0] = "/usr/sbin/semanage";
args[1] = "login";
args[2] = "-d";
args[3] = user_name;
args[4] = NULL;
safe_system (args[0], args, NULL, 1);
}
#endif
/*
* Get my name so that I can use it to report errors.
*/
@ -1010,6 +999,18 @@ int main (int argc, char **argv)
}
#endif
#ifdef WITH_SELINUX
if (is_selinux_enabled () > 0) {
const char *args[5];
args[0] = "/usr/sbin/semanage";
args[1] = "login";
args[2] = "-d";
args[3] = user_name;
args[4] = NULL;
safe_system (args[0], args, NULL, 1);
}
#endif
/*
* Cancel any crontabs or at jobs. Have to do this before we remove
* the entry from /etc/passwd.