All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eamon Walsh <ewalsh@tycho.nsa.gov>
To: SELinux List <selinux@tycho.nsa.gov>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Subject: [PATCH 3/3] libselinux: minor updates to AVC, mapping, callbacks
Date: Thu, 04 Oct 2007 14:10:11 -0400	[thread overview]
Message-ID: <47052C83.3020703@tycho.nsa.gov> (raw)
In-Reply-To: <47041CB6.8070408@tycho.nsa.gov>

This patch allows empty strings to be specified as permissions in
the dynamic permission mapping.  An empty string will be interpreted
as a "skipped bit" which allows userspace object managers to use
non-contiguous permission bits.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
---

 mapping.c |    6 ++++++
 1 file changed, 6 insertions(+)


Index: libselinux/src/mapping.c
===================================================================
--- libselinux/src/mapping.c	(revision 2628)
+++ libselinux/src/mapping.c	(working copy)
@@ -68,6 +68,11 @@
 
 		k = 0;
 		while (p_in->perms && p_in->perms[k]) {
+			/* An empty permission string skips ahead */
+			if (!*p_in->perms[k]) {
+				k++;
+				continue;
+			}
 			p_out->perms[k] = string_to_av_perm(p_out->value,
 							    p_in->perms[k]);
 			if (!p_out->perms[k])
@@ -111,6 +116,7 @@
 
 		for (i=0; i<current_mapping[tclass].num_perms; i++)
 			if (tperm & (1<<i)) {
+				assert(current_mapping[tclass].perms[i]);
 				kperm |= current_mapping[tclass].perms[i];
 				tperm &= ~(1<<i);
 			}



-- 
Eamon Walsh <ewalsh@tycho.nsa.gov>
National Security Agency


--
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.

  parent reply	other threads:[~2007-10-04 18:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-03 22:50 [PATCH 1/3] libselinux: minor updates to AVC, mapping, callbacks Eamon Walsh
2007-10-04 18:01 ` [PATCH 2/3] " Eamon Walsh
2007-10-04 18:10 ` Eamon Walsh [this message]
2007-10-04 19:09   ` [PATCH 3/3] " Joshua Brindle
2007-10-04 19:53     ` Eamon Walsh
2007-10-05 14:23   ` Stephen Smalley

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=47052C83.3020703@tycho.nsa.gov \
    --to=ewalsh@tycho.nsa.gov \
    --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.