All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] setfiles fails to relabel if selinux not enabled
@ 2009-09-15 19:20 Caleb Case
  2009-09-15 19:33 ` Stephen Smalley
  2009-09-16 21:13 ` Joshua Brindle
  0 siblings, 2 replies; 10+ messages in thread
From: Caleb Case @ 2009-09-15 19:20 UTC (permalink / raw)
  To: selinux, jbrindle, sds; +Cc: Caleb Case

Setfiles now checks the capabilities on the mounted file systems for
'seclabel' (see setfiles/setfiles.c:723:exclude_non_seclabel_mounts) on
newer kernels (>=2.6.30 see setfiles.c:734). However the 'seclabel'
feature is not available if selinux is not enabled. The result is that
setfiles silently fails to relabel any filesystems.

The patch below removes the check for seclabel if selinux is disabled.

As an alternative maybe seclabel should be available even if selinux is
disabled? It seems that whether a fs supports security labels is
independent of selinux being enabled.
---
 policycoreutils/setfiles/setfiles.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/policycoreutils/setfiles/setfiles.c b/policycoreutils/setfiles/setfiles.c
index 313767a..db2857f 100644
--- a/policycoreutils/setfiles/setfiles.c
+++ b/policycoreutils/setfiles/setfiles.c
@@ -750,6 +750,8 @@ static void exclude_non_seclabel_mounts()
 	/* Check to see if the kernel supports seclabel */
 	if (uname(&uts) == 0 && strverscmp(uts.release, "2.6.30") < 0)
 		return;
+	if (is_selinux_enabled() <= 0)
+		return;
 
 	fp = fopen("/proc/mounts", "r");
 	if (!fp)
-- 
1.6.0.4


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-09-16 21:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-15 19:20 [PATCH] setfiles fails to relabel if selinux not enabled Caleb Case
2009-09-15 19:33 ` Stephen Smalley
2009-09-15 20:23   ` Joshua Brindle
2009-09-15 20:48     ` Daniel J Walsh
2009-09-16 14:02     ` Stephen Smalley
2009-09-16 14:16       ` Jeff Johnson
2009-09-16 14:36         ` Stephen Smalley
2009-09-16 17:21           ` Jeff Johnson
2009-09-16 19:26             ` Stephen Smalley
2009-09-16 21:13 ` Joshua Brindle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.