summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-04-14 23:07:27 +0000
committerJeremy Katz <katzj@redhat.com>2004-04-14 23:07:27 +0000
commitd86ec9bef2930af4130404d5c5724c35cf279d6d (patch)
tree053013ea05b2b0cce58a1ae2980698c07ff55436
parenteb9d994255ae2d2979f12529bfd62ed3e4981eee (diff)
downloadanaconda-d86ec9bef2930af4130404d5c5724c35cf279d6d.tar.gz
anaconda-d86ec9bef2930af4130404d5c5724c35cf279d6d.tar.xz
anaconda-d86ec9bef2930af4130404d5c5724c35cf279d6d.zip
load selinux policy before we start the shell on tty2. we lose the ability
to put policy updates in an updates.img, but it means that the shell is somewhat sane
-rw-r--r--loader2/loader.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/loader2/loader.c b/loader2/loader.c
index f2e47f4c9..40250f42f 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -1256,6 +1256,20 @@ int main(int argc, char ** argv) {
migrate_runtime_directory("/lib64");
}
+ /* now load SELinux policy before exec'ing anaconda and the shell
+ * (if we're using SELinux) */
+ if (FL_SELINUX(flags)) {
+ if (mount("/selinux", "/selinux", "selinuxfs", 0, NULL)) {
+ logMessage("failed to mount /selinux: %s", strerror(errno));
+ } else {
+ if (loadpolicy() == 0) {
+ setexeccon(ANACONDA_CONTEXT);
+ } else {
+ flags &= ~LOADER_FLAGS_SELINUX;
+ }
+ }
+ }
+
logMessage("getting ready to spawn shell now");
spawnShell(flags); /* we can attach gdb now :-) */
@@ -1348,20 +1362,6 @@ int main(int argc, char ** argv) {
if (access("/tmp/updates", F_OK))
mkdirChain("/tmp/updates");
- /* now load SELinux policy before exec'ing anaconda (unless we've
- * specified not to */
- if (FL_SELINUX(flags)) {
- if (mount("/selinux", "/selinux", "selinuxfs", 0, NULL)) {
- logMessage("failed to mount /selinux: %s", strerror(errno));
- } else {
- if (loadpolicy() == 0) {
- setexeccon(ANACONDA_CONTEXT);
- } else {
- flags &= ~LOADER_FLAGS_SELINUX;
- }
- }
- }
-
logMessage("Running anaconda script %s", *(argptr-1));
*argptr++ = "-m";