Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 293643 Details for
Bug 431111
initramfs needs to be able to load SELinux policy
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch!
mkinitrd-policy.patch (text/plain), 2.39 KB, created by
Bill Nottingham
on 2008-01-31 20:16:37 UTC
(
hide
)
Description:
Patch!
Filename:
MIME Type:
Creator:
Bill Nottingham
Created:
2008-01-31 20:16:37 UTC
Size:
2.39 KB
patch
obsolete
>diff -up mkinitrd-6.0.28/nash/nash.c.foo mkinitrd-6.0.28/nash/nash.c >--- mkinitrd-6.0.28/nash/nash.c.foo 2008-01-09 12:12:28.000000000 -0500 >+++ mkinitrd-6.0.28/nash/nash.c 2008-01-24 16:28:20.000000000 -0500 >@@ -60,6 +60,8 @@ > > #include <libdevmapper.h> > >+#include <selinux/selinux.h> >+ > #include <bdevid.h> > > #include <nash.h> >@@ -1718,6 +1720,54 @@ mkdirCommand(char * cmd, char * end) > return 0; > } > >+ >+static int >+loadPolicyCommand(char * cmd, char *end) >+{ >+ int enforce = 0; >+ int rootfd; >+ >+ rootfd = open("/", O_DIRECTORY|O_RDONLY); >+ >+ if (rootfd < 0) { >+ eprintf("loadpolicy: could not open directory: %m\n"); >+ return 1; >+ } >+ >+ if (chdir("/sysroot") != 0) { >+ eprintf("loadpolicy: unable to change directory: %m\n"); >+ close(rootfd); >+ return 1; >+ } >+ >+ if (chroot("/sysroot") != 0) { >+ eprintf("loadpolicy: chroot failed: %m\n"); >+ close(rootfd); >+ return 1; >+ } >+ >+ if (selinux_init_load_policy(&enforce) != 0 && enforce > 0) { >+ eprintf("Unable to load SELinux policy (%m). Halting now.\n"); >+ sleep(-1); >+ exit(1); >+ } >+ >+ if (fchdir(rootfd) < 0) { >+ eprintf("loadpolicy: unable to change directory: %m\n"); >+ sleep(-1); >+ exit(1); >+ } >+ >+ if (chroot("..") < 0) { >+ eprintf("loadpolicy: chroot failed: %m\n"); >+ sleep(-1); >+ exit(1); >+ } >+ >+ close(rootfd); >+ return 0; >+} >+ > static int > accessCommand(char * cmd, char * end) > { >@@ -2728,6 +2778,7 @@ static const struct commandHandler handl > { "find", findCommand }, > { "kernelopt", printKernelOpt }, > { "loadDrivers", loadDriversCommand }, >+ { "loadpolicy", loadPolicyCommand }, > { "mkblktab", mkblktabCommand }, > { "mkblkdevs", mkblkdevsCommand }, > { "mkdir", mkdirCommand }, >diff -up mkinitrd-6.0.28/mkinitrd.foo mkinitrd-6.0.28/mkinitrd >--- mkinitrd-6.0.28/mkinitrd.foo 2008-01-23 17:09:26.000000000 -0500 >+++ mkinitrd-6.0.28/mkinitrd 2008-01-23 17:10:23.000000000 -0500 >@@ -1692,6 +1692,13 @@ if [ -n "$dhclient_leases_cmd" ]; then > emit "$dhclient_leases_cmd" > fi > >+SELINUX= >+[ -f /etc/selinux/config ] && . /etc/selinux/config >+if [ -n "$SELINUX" -a "$SELINUX" != "disabled" ]; then >+ emit "echo Loading SELinux policy." >+ emit "loadpolicy" >+fi >+ > emit "echo Switching to new root and running init." > emit "switchroot" > emit "echo Booting has failed."
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 431111
: 293643