Skip to contentSkip to conversation

checkpolicy

PATCH In review Joerg Hoh 2 participants 2 messages Oct 20, 2003 SELinux security module

lore
Share & tools
lore

Joerg Hoh

author
#0 lore raw

PATCH 1/1 checkpolicy

- use unsigned int instead of unsigned long as bit specifier
files: ebitmap.{c,h}

Joerg

ebitmap.c +6 -6
Index: ebitmap.c
===================================================================
@@ -139,7 +139,7 @@
 }
 
 
-int ebitmap_get_bit(ebitmap_t * e, unsigned long bit)
+int ebitmap_get_bit(ebitmap_t * e, unsigned int bit)
 {
 	ebitmap_node_t *n;
 
@@ -162,7 +162,7 @@
 }
 
 
-int ebitmap_set_bit(ebitmap_t * e, unsigned long bit, int value)
+int ebitmap_set_bit(ebitmap_t * e, unsigned int bit, int value)
 {
 	ebitmap_node_t *n, *prev, *new;
 
@@ -269,7 +269,7 @@
 	count = le32_to_cpu(buf[2]);
 
 	if (mapsize != MAPSIZE) {
-		printk("security: ebitmap: map size %d does not match my size %d (high bit was %d)\n", mapsize, MAPSIZE, e->highbit);
+		printk("security: ebitmap: map size %d does not match my size %zu (high bit was %d)\n", mapsize, MAPSIZE, e->highbit);
 		goto out;
 	}
 	if (!e->highbit) {
@@ -277,7 +277,7 @@
 		goto ok;
 	}
 	if (e->highbit & (MAPSIZE - 1)) {
-		printk("security: ebitmap: high bit (%d) is not a multiple of the map size (%d)\n", e->highbit, MAPSIZE);
+		printk("security: ebitmap: high bit (%d) is not a multiple of the map size (%zu)\n", e->highbit, MAPSIZE);
 		goto bad;
 	}
 	l = NULL;
@@ -298,11 +298,11 @@
 		n->startbit = le32_to_cpu(buf[0]);
 
 		if (n->startbit & (MAPSIZE - 1)) {
-			printk("security: ebitmap start bit (%d) is not a multiple of the map size (%d)\n", n->startbit, MAPSIZE);
+			printk("security: ebitmap start bit (%d) is not a multiple of the map size (%zu)\n", n->startbit, MAPSIZE);
 			goto bad_free;
 		}
 		if (n->startbit > (e->highbit - MAPSIZE)) {
-			printk("security: ebitmap start bit (%d) is beyond the end of the bitmap (%d)\n", n->startbit, (e->highbit - MAPSIZE));
+			printk("security: ebitmap start bit (%d) is beyond the end of the bitmap (%zu)\n", n->startbit, (e->highbit - MAPSIZE));
 			goto bad_free;
 		}
 		buf = next_entry(fp, sizeof(__u64));
ebitmap.h +2 -2
Index: ebitmap.h
===================================================================
@@ -46,8 +46,8 @@
 int ebitmap_or(ebitmap_t * dst, ebitmap_t * e1, ebitmap_t * e2);
 int ebitmap_cpy(ebitmap_t * dst, ebitmap_t * src);
 int ebitmap_contains(ebitmap_t * e1, ebitmap_t * e2);
-int ebitmap_get_bit(ebitmap_t * e, unsigned long bit);
-int ebitmap_set_bit(ebitmap_t * e, unsigned long bit, int value);
+int ebitmap_get_bit(ebitmap_t * e, unsigned int bit);
+int ebitmap_set_bit(ebitmap_t * e, unsigned int bit, int value);
 void ebitmap_destroy(ebitmap_t * e);
 int ebitmap_read(ebitmap_t * e, void * fp);
 
#1 lore raw
Quoted 2 lines · Joerg Hoh

- use unsigned int instead of unsigned long as bit specifier
files: ebitmap.{c,h}

Thanks, merged.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.