All of lore.kernel.org
 help / color / mirror / Atom feed
* [ SELINUX ] Make rpm_execcon failure non-fatal in permissive mode.
@ 2005-11-15  5:40 Ivan Gyurdiev
  2005-11-15 11:39 ` Stephen Smalley
  2005-11-15 12:54 ` Stephen Smalley
  0 siblings, 2 replies; 4+ messages in thread
From: Ivan Gyurdiev @ 2005-11-15  5:40 UTC (permalink / raw)
  To: SELinux List; +Cc: Stephen Smalley

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

Changelog: Makes failure in rpm_execcon non-fatal in permissive mode.
See: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=173094

P.S. I'm not sure why an rpm-specific function is in the shared library 
- seems strange to me.

[-- Attachment #2: libselinux.rpm_respect_mode.diff --]
[-- Type: text/x-patch, Size: 790 bytes --]

diff -Naurp --exclude CVS --exclude ChangeLog --exclude VERSION old/libselinux/src/rpm.c new/libselinux/src/rpm.c
--- old/libselinux/src/rpm.c	2005-08-25 11:32:02.000000000 -0400
+++ new/libselinux/src/rpm.c	2005-11-15 00:27:14.000000000 -0500
@@ -11,7 +11,7 @@ int rpm_execcon(unsigned int verified __
 {
 	security_context_t mycon = NULL, fcon = NULL, newcon = NULL;
 	context_t con = NULL;
-	int rc;
+	int rc = 0;
 
 	if (is_selinux_enabled() < 1)
 		return execve(filename, argv, envp);
@@ -44,8 +44,11 @@ int rpm_execcon(unsigned int verified __
 	rc = setexeccon(newcon);
 	if (rc < 0) 
 		goto out;
-	rc = execve(filename, argv, envp);
 out:
+
+	if (rc >= 0 || !security_getenforce())
+		rc = execve(filename, argv, envp); 
+
 	context_free(con);
 	freecon(newcon);
 	freecon(fcon);

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

end of thread, other threads:[~2005-11-15 13:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-15  5:40 [ SELINUX ] Make rpm_execcon failure non-fatal in permissive mode Ivan Gyurdiev
2005-11-15 11:39 ` Stephen Smalley
2005-11-15 12:54 ` Stephen Smalley
2005-11-15 13:26   ` Stephen Smalley

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.