| 
      
      
      From: <ssm...@us...> - 2007-10-05 13:46:14
      
     | 
| Revision: 2635
          http://selinux.svn.sourceforge.net/selinux/?rev=2635&view=rev
Author:   ssmalley
Date:     2007-10-05 06:46:13 -0700 (Fri, 05 Oct 2007)
Log Message:
-----------
Author: Eamon Walsh
Email: ew...@ty...
Subject: libselinux: minor updates to AVC, mapping, callbacks
Date: Thu, 04 Oct 2007 14:10:11 -0400
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 <ew...@ty...>
Modified Paths:
--------------
    trunk/libselinux/src/mapping.c
Modified: trunk/libselinux/src/mapping.c
===================================================================
--- trunk/libselinux/src/mapping.c	2007-10-05 13:45:54 UTC (rev 2634)
+++ trunk/libselinux/src/mapping.c	2007-10-05 13:46:13 UTC (rev 2635)
@@ -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);
 			}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |