All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>, SE Linux <selinux@tycho.nsa.gov>
Subject: get_default_context_with_level seems to be broken in libselinux.
Date: Mon, 12 Feb 2007 10:15:59 -0500	[thread overview]
Message-ID: <45D084AF.8020405@redhat.com> (raw)

[-- 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;

             reply	other threads:[~2007-02-12 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-12 15:15 Daniel J Walsh [this message]
2007-02-12 16:16 ` get_default_context_with_level seems to be broken in libselinux Stephen Smalley
2007-02-12 17:51   ` Stephen Smalley
2007-02-12 18:43     ` Daniel J Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45D084AF.8020405@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.