Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebuilding without make bare after changing CONFIG_BUILD variables has unpredictable behavior #179

Open
minapoli opened this issue Jun 4, 2015 · 3 comments

Comments

@minapoli
Copy link
Contributor

minapoli commented Jun 4, 2015

trying to use sudo on a debug build results in the following error:
system_u:toor_r:toor_t:s0-s0:c0.c1023 is not a valid context
The system is running in permissive, but this error prevents the sudo command from working

@ghost ghost assigned mpalmi Jun 4, 2015
@ghost ghost added this to the RHEL_7-Alpha3 milestone Jun 4, 2015
@ghost
Copy link

ghost commented Jun 4, 2015

Can you please take a look at this

@mpalmi
Copy link
Contributor

mpalmi commented Jun 4, 2015

@minapoli commented an hour ago
trying to use sudo on a debug build results in the following error:
system_u:toor_r:toor_t:s0-s0:c0.c1023 is not a valid context
The system is running in permissive, but this error prevents the sudo command from working

This is a symptom of a bad file context -- typically it results from semodule failing to load the base policy module because it contains a bad file context. I built off of master with a make bare and bootstrap.sh and the following change:

diff --git a/packages/clip-selinux-policy/clip-selinux-policy.spec b/packages/clip-selinux-policy/clip-selinux-policy.spec
index f8b0e7b..3bb5a25 100644
--- a/packages/clip-selinux-policy/clip-selinux-policy.spec
+++ b/packages/clip-selinux-policy/clip-selinux-policy.spec
@@ -128,7 +128,7 @@ fi
 
 %define loadpolicy() \
 . %{_sysconfdir}/selinux/config; \
-( cd /usr/share/selinux/%1; semodule -n -b base.pp.bz2 -i %2 -s %1 &> /dev/null ); \
+( cd /usr/share/selinux/%1; semodule -n -b base.pp.bz2 -i %2 -s %1 &> /tmp/load_policy.log ); \
 
 %define relabel() \
 . %{_sysconfdir}/selinux/config; \
@@ -136,7 +136,7 @@ FILE_CONTEXT=%{_sysconfdir}/selinux/%1/contexts/files/file_contexts; \
 selinuxenabled; \
 if [ $? = 0  -a "${SELINUXTYPE}" = %1 -a -f ${FILE_CONTEXT}.pre ]; then \
      fixfiles -C ${FILE_CONTEXT}.pre restore; \
-     restorecon -RF / &> /dev/null; \
+     restorecon -RF / &> /tmp/relabel.log; \
      rm -f ${FILE_CONTEXT}.pre; \
 fi;

and did not have any issues with sudo. There were no error messages seen in /tmp/load_policy.log nor /tmp/relabel.log.

@ghost
Copy link

ghost commented Jun 4, 2015

Doing a make bare fixes this. It might be an issue with rebuilding when changing variables in CONFIG_BUILD

@ghost ghost changed the title cannot use sudo in a debug build rebuilding without make bare after changing CONFIG_BUILD variables has unpredictable behavior Jun 4, 2015
@ghost ghost modified the milestones: RHEL_7-Beta, RHEL_7-Alpha3 Jun 4, 2015
@ghost ghost assigned ghost and unassigned mpalmi Jun 4, 2015
@ghost ghost removed the selinux label Jun 4, 2015
@ghost ghost modified the milestones: RHEL_7_Final, RHEL_7-Beta Sep 9, 2015
@ghost ghost modified the milestones: Future, RHEL_7_Final Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants