All of lore.kernel.org
 help / color / mirror / Atom feed
* get_default_context_with_level seems to be broken in libselinux.
@ 2007-02-12 15:15 Daniel J Walsh
  2007-02-12 16:16 ` Stephen Smalley
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel J Walsh @ 2007-02-12 15:15 UTC (permalink / raw)
  To: Stephen Smalley, SE Linux

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

Bugzilla's 211827 224637 
<https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224637>

Show that the values after the comma are being dropped.

Adding the attached patch fixes the problem.

But I am not sure of the intended use of this code.  The current code 
does not work and looks like it never worked.  Was there an intention 
that this would work differently?


Dan



[-- Attachment #2: default_level.patch --]
[-- Type: text/x-patch, Size: 564 bytes --]

--- libselinux-1.33.4/src/get_context_list.c~	2007-01-11 14:01:23.000000000 -0500
+++ libselinux-1.33.4/src/get_context_list.c	2007-02-09 15:43:31.000000000 -0500
@@ -381,12 +381,16 @@
 {
 	security_context_t *conary;
 	int rc;
-
+	context_t con;
 	rc = get_ordered_context_list_with_level(user, level, fromcon, &conary);
 	if (rc <= 0)
 		return -1;
 
-	*newcon = strdup(conary[0]);
+	con = context_new(conary[0]);
+	context_range_set(con, level);
+	*newcon = strdup(context_str(con));
+	context_free(con);
+
 	freeconary(conary);
 	if (!(*newcon))
 		return -1;

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

end of thread, other threads:[~2007-02-12 18:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12 15:15 get_default_context_with_level seems to be broken in libselinux Daniel J Walsh
2007-02-12 16:16 ` Stephen Smalley
2007-02-12 17:51   ` Stephen Smalley
2007-02-12 18:43     ` Daniel J Walsh

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.