checkpolicy patch
hi folks
this patch fixes the following issues in checkpolicy (files: symtab.c, policydb.{c,h}:
- size_t vs. int, unsigned int, __u32
- use struct policy_file instead of opaque void pointer
- mark some attributes as unused
it applies and builds cleanly with current sf cvs version
bastian
Signature · 7 lines
The heart is not a logical organ. -- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4 -- 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.
i forget the patch
bastian
Signature · 2 lines
We do not colonize. We conquer. We rule. There is no other way for us. -- Rojan, "By Any Other Name", stardate 4657.5
symtab.c +3 -3
@@ -12,19 +12,19 @@static unsigned int symhash (hashtab_t h,hashtab_key_t key) {char *p, *keyp; -unsigned int size; +size_t size;unsigned int val; val =0 ; keyp = (char *) key; size =strlen (keyp); -for (p = keyp; (p - keyp) < size; p++) +for (p = keyp; ((size_t )(p - keyp)) < size; p++) val = (val <<4 | (val >> (8 *sizeof (unsigned int )-4 ))) ^ (*p);return val & (h->size -1 ); } -static int symcmp (hashtab_t h,hashtab_key_t key1,hashtab_key_t key2) +static int symcmp (hashtab_t h __attribute__ ((unused)),hashtab_key_t key1,hashtab_key_t key2) {char *keyp1, *keyp2;
policydb.c +35 -27
189 lines not on this page · raw message
policydb.h +3 -1
@@ -237,8 +237,10 @@extern int policydb_context_isvalid (policydb_t *p,context_struct_t *c); -extern int policydb_read (policydb_t * p,void * fp); +struct policy_file ; +extern int policydb_read (policydb_t * p,struct policy_file * fp); +#define PERM_SYMTAB_SIZE 32#define POLICYDB_VERSION 15
Quoted 9 lines · Bastian Blank
hi folks
this patch fixes the following issues in checkpolicy (files:
symtab.c, policydb.{c,h}:
-size_tvs. int, unsigned int,__u32
- use structpolicy_fileinstead of opaque void pointer
- mark some attributes as unusedit applies and builds cleanly with current sf cvs version
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.