libsepol: use constant keys in hashtab functions
PATCH 1/5 libsepol: use constant keys in hashtab functions
Even though "hashtab_key_t" is an alias for "char *", "const hashtab_key_t" is not an alias for "(const char) *" but means "(char *) const".
Introduce const_hashtab_key_t to map "(const char) *" and use it in hashtab_search() and hashtab key comparison functions.
--- libsepol/cil/src/cil_binary.c | 48 ++++++++++++++-------------- libsepol/cil/src/cil_strpool.c | 12 +++---- libsepol/include/sepol/policydb/hashtab.h | 13 ++++---- libsepol/src/hashtab.c | 8 ++--- libsepol/src/policydb.c | 8 ++--- libsepol/src/roles.c | 3 +- libsepol/src/symtab.c | 16 ++++------ libsepol/src/users.c | 12 +++---- policycoreutils/newrole/hashtab.c | 8 ++--- policycoreutils/newrole/hashtab.h | 13 ++++---- policycoreutils/newrole/newrole.c | 12 +++---- semodule-utils/semodule_deps/semodule_deps.c | 16 ++++------ 12 files changed, 77 insertions(+), 92 deletions(-)
libsepol/cil/src/cil_binary.c +24 -24
@@ -4027,53 +4027,53 @@ exit:return rc; } -static unsigned int filename_trans_hash (hashtab_t h,hashtab_key_t key) +static unsigned int filename_trans_hash (hashtab_t h,const_hashtab_key_t key) { -filename_trans_t *k = (filename_trans_t *)key; +const filename_trans_t *k = (const filename_trans_t *)key;return ((k->tclass + (k->ttype <<2 ) + (k->stype <<9 )) & (h->size -1 )); }static int filename_trans_compare (hashtab_t h - __attribute__ ((unused)),hashtab_key_t key1, -hashtab_key_t key2) + __attribute__ ((unused)),const_hashtab_key_t key1, +const_hashtab_key_t key2) { -filename_trans_t *a = (filename_trans_t *)key1; -filename_trans_t *b = (filename_trans_t *)key2; +const filename_trans_t *a = (const filename_trans_t *)key1; +const filename_trans_t *b = (const filename_trans_t *)key2;return a->stype != b->stype || a->ttype != b->ttype || a->tclass != b->tclass ||strcmp (a->name, b->name); } -static unsigned int range_trans_hash (hashtab_t h,hashtab_key_t key) +static unsigned int range_trans_hash (hashtab_t h,const_hashtab_key_t key) { -range_trans_t *k = (range_trans_t *)key; +const range_trans_t *k = (const range_trans_t *)key;return ((k->target_class + (k->target_type <<2 ) + (k->source_type <<5 )) & (h->size -1 )); }static int range_trans_compare (hashtab_t h - __attribute__ ((unused)),hashtab_key_t key1, -hashtab_key_t key2) + __attribute__ ((unused)),const_hashtab_key_t key1, +const_hashtab_key_t key2) { -range_trans_t *a = (range_trans_t *)key1; -range_trans_t *b = (range_trans_t *)key2; +const range_trans_t *a = (const range_trans_t *)key1; +const range_trans_t *b = (const range_trans_t *)key2;return a->source_type != b->source_type || a->target_type != b->target_type || a->target_class != b->target_class; } -static unsigned int role_trans_hash (hashtab_t h,hashtab_key_t key) +static unsigned int role_trans_hash (hashtab_t h,const_hashtab_key_t key) { -role_trans_t *k = (role_trans_t *)key; +const role_trans_t *k = (const role_trans_t *)key;return ((k->role + (k->type <<2 ) + (k->tclass <<5 )) & (h->size -1 )); }static int role_trans_compare (hashtab_t h - __attribute__ ((unused)),hashtab_key_t key1, -hashtab_key_t key2) + __attribute__ ((unused)),const_hashtab_key_t key1, +const_hashtab_key_t key2) { -role_trans_t *a = (role_trans_t *)key1; -role_trans_t *b = (role_trans_t *)key2; +const role_trans_t *a = (const role_trans_t *)key1; +const role_trans_t *b = (const role_trans_t *)key2;return a->role != b->role || a->type != b->type || a->tclass != b->tclass; }
@@ -4081,9 +4081,9 @@ static int role_trans_compare(hashtab_t h/* Based on MurmurHash3, written by Austin Appleby and placed in the * public domain. */ -static unsigned int avrulex_hash (__attribute__((unused))hashtab_t h,hashtab_key_t key) +static unsigned int avrulex_hash (__attribute__((unused))hashtab_t h,const_hashtab_key_t key) { -avtab_key_t *k = (avtab_key_t *)key; +const avtab_key_t *k = (const avtab_key_t *)key;static const uint32_t c1 =0xcc9e2d51 ;static const uint32_t c2 =0x1b873593 ;
@@ -4121,11 +4121,11 @@ static unsigned int avrulex_hash(__attribute__((unused)) hashtab_t h, hashtab_ke }static int avrulex_compare (hashtab_t h - __attribute__ ((unused)),hashtab_key_t key1, -hashtab_key_t key2) + __attribute__ ((unused)),const_hashtab_key_t key1, +const_hashtab_key_t key2) { -avtab_key_t *a = (avtab_key_t *)key1; -avtab_key_t *b = (avtab_key_t *)key2; +const avtab_key_t *a = (const avtab_key_t *)key1; +const avtab_key_t *b = (const avtab_key_t *)key2;return a->source_type != b->source_type || a->target_type != b->target_type || a->target_class != b->target_class || a->specified != b->specified; }
libsepol/cil/src/cil_strpool.c +6 -6
@@ -45,14 +45,14 @@ static pthread_mutex_t cil_strpool_mutex = PTHREAD_MUTEX_INITIALIZER;static unsigned int cil_strpool_readers =0 ;static hashtab_t cil_strpool_tab =NULL ; -static unsigned int cil_strpool_hash (hashtab_t h,hashtab_key_t key) +static unsigned int cil_strpool_hash (hashtab_t h,const_hashtab_key_t key) { -char *p, *keyp; +const char *p, *keyp;size_t size;unsigned int val; val =0 ; - keyp = (char *)key; + keyp = (const char *)key; size =strlen (keyp);for (p = keyp; ((size_t ) (p - keyp)) < size; p++) val =
@@ -60,10 +60,10 @@ static unsigned int cil_strpool_hash(hashtab_t h, hashtab_key_t key)return val & (h->size -1 ); } -static int cil_strpool_compare (hashtab_t h __attribute__ ((unused)),hashtab_key_t key1,hashtab_key_t key2) +static int cil_strpool_compare (hashtab_t h __attribute__ ((unused)),const_hashtab_key_t key1,const_hashtab_key_t key2) { -char *keyp1 = (char *)key1; -char *keyp2 = (char *)key2; +const char *keyp1 = (const char *)key1; +const char *keyp2 = (const char *)key2;return strcmp (keyp1, keyp2); }
libsepol/include/sepol/policydb/hashtab.h +7 -6
@@ -23,6 +23,7 @@ extern "C" {#endif typedef char *hashtab_key_t ;/* generic key type */ +typedef const char *const_hashtab_key_t ;/* constant generic key type */ typedef void *hashtab_datum_t ;/* generic datum type */ typedef struct hashtab_node *hashtab_ptr_t ;
@@ -37,8 +38,8 @@ typedef struct hashtab_val {hashtab_ptr_t *htable;/* hash table */ unsigned int size;/* number of slots in hash table */ uint32_t nel;/* number of elements in hash table */ -unsigned int (*hash_value) (struct hashtab_val * h,hashtab_key_t key);/* hash function */ -int (*keycmp) (struct hashtab_val * h,hashtab_key_t key1,hashtab_key_t key2);/* key comparison function */ +unsigned int (*hash_value) (struct hashtab_val * h,const_hashtab_key_t key);/* hash function */ +int (*keycmp) (struct hashtab_val * h,const_hashtab_key_t key1,const_hashtab_key_t key2);/* key comparison function */ } hashtab_val_t;typedef hashtab_val_t *hashtab_t ;
@@ -50,11 +51,11 @@ typedef hashtab_val_t *hashtab_t;the new hash table otherwise. */ extern hashtab_t hashtab_create (unsigned int (*hash_value) (hashtab_t h, -const hashtab_key_t +const_hashtab_key_t key),int (*keycmp) (hashtab_t h, -const hashtab_key_t key1, -const hashtab_key_t key2), +const_hashtab_key_t key1, +const_hashtab_key_t key2),unsigned int size);/* Inserts the specified (key, datum) pair into the specified hash table.
@@ -98,7 +99,7 @@ extern int hashtab_replace(hashtab_t h, hashtab_key_t k, hashtab_datum_t d,Returns NULL if no entry has the specified key or the datum of the entry otherwise. */ -extern hashtab_datum_t hashtab_search (hashtab_t h,const hashtab_key_t k); +extern hashtab_datum_t hashtab_search (hashtab_t h,const_hashtab_key_t k);/* Destroys the specified hash table.
libsepol/src/hashtab.c +4 -4
@@ -33,10 +33,10 @@#include <sepol/policydb/hashtab.h> hashtab_t hashtab_create (unsigned int (*hash_value) (hashtab_t h, -const hashtab_key_t key), +const_hashtab_key_t key),int (*keycmp) (hashtab_t h, -const hashtab_key_t key1, -const hashtab_key_t key2), +const_hashtab_key_t key1, +const_hashtab_key_t key2),unsigned int size) {
@@ -175,7 +175,7 @@ int hashtab_replace(hashtab_t h, hashtab_key_t key, hashtab_datum_t datum,return SEPOL_OK ; } -hashtab_datum_t hashtab_search (hashtab_t h,const hashtab_key_t key) +hashtab_datum_t hashtab_search (hashtab_t h,const_hashtab_key_t key) {int hvalue;
libsepol/src/policydb.c +4 -4
@@ -727,7 +727,7 @@ partial_name_hash(unsigned long c, unsigned long prevhash)return (prevhash + (c <<4 ) + (c >>4 )) *11 ; } -static unsigned int filenametr_hash (hashtab_t h,hashtab_key_t k) +static unsigned int filenametr_hash (hashtab_t h,const_hashtab_key_t k) {const struct filename_trans *ft = (const struct filename_trans *)k;unsigned long hash;
@@ -743,7 +743,7 @@ static unsigned int filenametr_hash(hashtab_t h, hashtab_key_t k) }static int filenametr_cmp (hashtab_t h __attribute__ ((unused)), -hashtab_key_t k1,hashtab_key_t k2) +const_hashtab_key_t k1,const_hashtab_key_t k2) {const struct filename_trans *ft1 = (const struct filename_trans *)k1;const struct filename_trans *ft2 = (const struct filename_trans *)k2;
@@ -765,7 +765,7 @@ static int filenametr_cmp(hashtab_t h __attribute__ ((unused)), } -static unsigned int rangetr_hash (hashtab_t h,hashtab_key_t k) +static unsigned int rangetr_hash (hashtab_t h,const_hashtab_key_t k) {const struct range_trans *key = (const struct range_trans *)k; return (key->source_type + (key->target_type << 3) +
@@ -773,7 +773,7 @@ static unsigned int rangetr_hash(hashtab_t h, hashtab_key_t k) }static int rangetr_cmp (hashtab_t h __attribute__ ((unused)), -hashtab_key_t k1,hashtab_key_t k2) +const_hashtab_key_t k1,const_hashtab_key_t k2) {const struct range_trans *key1 = (const struct range_trans *)k1;const struct range_trans *key2 = (const struct range_trans *)k2;
libsepol/src/roles.c +1 -2
@@ -13,8 +13,7 @@ int sepol_role_exists(sepol_handle_t * handle __attribute__ ((unused)), {policydb_t *policydb = &p->p; - *response = (hashtab_search (policydb->p_roles.table, - (const hashtab_key_t )role) !=NULL ); + *response = (hashtab_search (policydb->p_roles.table, role) !=NULL );return STATUS_SUCCESS ; }
libsepol/src/symtab.c +6 -10
@@ -11,14 +11,14 @@#include <sepol/policydb/hashtab.h> #include <sepol/policydb/symtab.h> -static unsigned int symhash (hashtab_t h,hashtab_key_t key) +static unsigned int symhash (hashtab_t h,const_hashtab_key_t key) { -char *p, *keyp; +const char *p, *keyp;size_t size;unsigned int val; val =0 ; - keyp = (char *)key; + keyp = (const char *)key; size =strlen (keyp);for (p = keyp; ((size_t ) (p - keyp)) < size; p++) val =
@@ -27,14 +27,10 @@ static unsigned int symhash(hashtab_t h, hashtab_key_t key) }static int symcmp (hashtab_t h - __attribute__ ((unused)),hashtab_key_t key1, -hashtab_key_t key2) + __attribute__ ((unused)),const_hashtab_key_t key1, +const_hashtab_key_t key2) { -char *keyp1, *keyp2; - - keyp1 = (char *)key1; - keyp2 = (char *)key2; -return strcmp (keyp1, keyp2); +return strcmp (key1, key2); }int symtab_init (symtab_t * s,unsigned int size)
libsepol/src/users.c +4 -8
@@ -139,8 +139,7 @@ int sepol_user_modify(sepol_handle_t * handle, goto err;/* Now, see if a user exists */ - usrdatum =hashtab_search (policydb->p_users.table, - (const hashtab_key_t )cname); + usrdatum =hashtab_search (policydb->p_users.table, cname);/* If it does, we will modify it */ if (usrdatum) {
@@ -163,8 +162,7 @@ int sepol_user_modify(sepol_handle_t * handle,for (i =0 ; i < num_roles; i++) {/* Search for the role */ - roldatum =hashtab_search (policydb->p_roles.table, - (const hashtab_key_t )roles[i]); + roldatum =hashtab_search (policydb->p_roles.table, roles[i]);if (!roldatum) {ERR (handle,"undefined role %s for user %s" , roles[i], cname);
@@ -301,8 +299,7 @@ int sepol_user_exists(sepol_handle_t * handle __attribute__ ((unused)),const char *cname;sepol_user_key_unpack (key, &cname); - *response = (hashtab_search (policydb->p_users.table, - (const hashtab_key_t )cname) !=NULL ); + *response = (hashtab_search (policydb->p_users.table, cname) !=NULL );return STATUS_SUCCESS ; }
@@ -328,8 +325,7 @@ int sepol_user_query(sepol_handle_t * handle,const char *cname;sepol_user_key_unpack (key, &cname); - usrdatum =hashtab_search (policydb->p_users.table, - (const hashtab_key_t )cname); + usrdatum =hashtab_search (policydb->p_users.table, cname);if (!usrdatum) { *response =NULL ;
policycoreutils/newrole/hashtab.c +4 -4
@@ -12,10 +12,10 @@#include "hashtab.h" hashtab_t hashtab_create (unsigned int (*hash_value) (hashtab_t h, -const hashtab_key_t key), +const_hashtab_key_t key),int (*keycmp) (hashtab_t h, -const hashtab_key_t key1, -const hashtab_key_t key2), +const_hashtab_key_t key1, +const_hashtab_key_t key2),unsigned int size) {
@@ -154,7 +154,7 @@ int hashtab_replace(hashtab_t h, hashtab_key_t key, hashtab_datum_t datum,return HASHTAB_SUCCESS ; } -hashtab_datum_t hashtab_search (hashtab_t h,const hashtab_key_t key) +hashtab_datum_t hashtab_search (hashtab_t h,const_hashtab_key_t key) {int hvalue;
policycoreutils/newrole/hashtab.h +7 -6
@@ -19,6 +19,7 @@#include <stdio.h> typedef char *hashtab_key_t ;/* generic key type */ +typedef const char *const_hashtab_key_t ;/* constant generic key type */ typedef void *hashtab_datum_t ;/* generic datum type */ typedef struct hashtab_node *hashtab_ptr_t ;
@@ -33,8 +34,8 @@ typedef struct hashtab_val {hashtab_ptr_t *htable;/* hash table */ unsigned int size;/* number of slots in hash table */ uint32_t nel;/* number of elements in hash table */ -unsigned int (*hash_value) (struct hashtab_val * h,hashtab_key_t key);/* hash function */ -int (*keycmp) (struct hashtab_val * h,hashtab_key_t key1,hashtab_key_t key2);/* key comparison function */ +unsigned int (*hash_value) (struct hashtab_val * h,const_hashtab_key_t key);/* hash function */ +int (*keycmp) (struct hashtab_val * h,const_hashtab_key_t key1,const_hashtab_key_t key2);/* key comparison function */ } hashtab_val_t;typedef hashtab_val_t *hashtab_t ;
@@ -52,11 +53,11 @@ typedef hashtab_val_t *hashtab_t;the new hash table otherwise. */ extern hashtab_t hashtab_create (unsigned int (*hash_value) (hashtab_t h, -const hashtab_key_t +const_hashtab_key_t key),int (*keycmp) (hashtab_t h, -const hashtab_key_t key1, -const hashtab_key_t key2), +const_hashtab_key_t key1, +const_hashtab_key_t key2),unsigned int size);/* Inserts the specified (key, datum) pair into the specified hash table.
@@ -100,7 +101,7 @@ extern int hashtab_replace(hashtab_t h, hashtab_key_t k, hashtab_datum_t d,Returns NULL if no entry has the specified key or the datum of the entry otherwise. */ -extern hashtab_datum_t hashtab_search (hashtab_t h,const hashtab_key_t k); +extern hashtab_datum_t hashtab_search (hashtab_t h,const_hashtab_key_t k);/* Destroys the specified hash table.
policycoreutils/newrole/newrole.c +4 -8
@@ -228,7 +228,7 @@ static int free_hashtab_entry(hashtab_key_t key, hashtab_datum_t d,return 0 ; } -static unsigned int reqsymhash (hashtab_t h,hashtab_key_t key) +static unsigned int reqsymhash (hashtab_t h,const_hashtab_key_t key) {char *p, *keyp;size_t size;
@@ -244,14 +244,10 @@ static unsigned int reqsymhash(hashtab_t h, hashtab_key_t key) }static int reqsymcmp (hashtab_t h - __attribute__ ((unused)),hashtab_key_t key1, -hashtab_key_t key2) + __attribute__ ((unused)),const_hashtab_key_t key1, +const_hashtab_key_t key2) { -char *keyp1, *keyp2; - - keyp1 = (char *)key1; - keyp2 = (char *)key2; -return strcmp (keyp1, keyp2); +return strcmp (key1, key2); }static hashtab_t app_service_names =NULL ;
semodule-utils/semodule_deps/semodule_deps.c +6 -10
@@ -52,14 +52,14 @@ static void usage(char *program_name)/* Basic string hash and compare for the hashtables used in * generate_requires. Copied from symtab.c. */ -static unsigned int reqsymhash (hashtab_t h,hashtab_key_t key) +static unsigned int reqsymhash (hashtab_t h,const_hashtab_key_t key) { -char *p, *keyp; +const char *p, *keyp;size_t size;unsigned int val; val =0 ; - keyp = (char *)key; + keyp = (const char *)key; size =strlen (keyp);for (p = keyp; ((size_t ) (p - keyp)) < size; p++) val =
@@ -68,14 +68,10 @@ static unsigned int reqsymhash(hashtab_t h, hashtab_key_t key) }static int reqsymcmp (hashtab_t h - __attribute__ ((unused)),hashtab_key_t key1, -hashtab_key_t key2) + __attribute__ ((unused)),const_hashtab_key_t key1, +const_hashtab_key_t key2) { -char *keyp1, *keyp2; - - keyp1 = (char *)key1; - keyp2 = (char *)key2; -return strcmp (keyp1, keyp2); +return strcmp (key1, key2); }/* Load a policy package from the given filename. Progname is used for
Signature · 1 line
2.11.0
PATCH 2/5 libsepol: verify the right variable after calling calloc()
After "otype = calloc(1, sizeof(*otype))", it is reasonable to check the value of otype, not ft.
--- libsepol/src/policydb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libsepol/src/policydb.c +1 -1
@@ -2558,7 +2558,7 @@ int filename_trans_read(policydb_t *p, struct policy_file *fp)if (!ft) goto err; otype =calloc (1 ,sizeof (*otype)); -if (!ft) +if (!otype) goto err; rc =next_entry (buf, fp,sizeof (uint32_t ));if (rc <0 )
Signature · 1 line
2.11.0
PATCH 3/5 libsepol: remove useless assignments
In reply to Nicolas IoossThere is no point in initializing a variable which gets almost-immediately assigned an other value.
--- libsepol/cil/src/cil_binary.c | 2 -- libsepol/src/write.c | 1 - 2 files changed, 3 deletions(-)
libsepol/cil/src/cil_binary.c +0 -2
@@ -2253,7 +2253,6 @@ int cil_roletrans_to_policydb(policydb_t *pdb, const struct cil_db *db, struct c new->tclass = sepol_obj->s.value; new->new_role = sepol_result->s.value; - rc =SEPOL_OK ; rc =hashtab_insert (role_trans_table, (hashtab_key_t )new, &(new->new_role));if (rc !=SEPOL_OK ) {if (rc ==SEPOL_EEXIST ) {
@@ -3041,7 +3040,6 @@ int cil_rangetransition_to_policydb(policydb_t *pdb, const struct cil_db *db, st goto exit; } - rc =SEPOL_OK ; rc =hashtab_insert (range_trans_table, (hashtab_key_t )newkey, newdatum);if (rc !=SEPOL_OK ) {if (rc ==SEPOL_EEXIST ) {
libsepol/src/write.c +0 -1
@@ -926,7 +926,6 @@ static int write_cons_helper(policydb_t * p,if (items !=2 )return POLICYDB_ERROR ;for (e = c->expr; e; e = e->next) { - items =0 ; buf[0 ] =cpu_to_le32 (e->expr_type); buf[1 ] =cpu_to_le32 (e->attr); buf[2 ] =cpu_to_le32 (e->op);
Signature · 1 line
2.11.0
PATCH 4/5 libselinux: always free catalog in db_init()
In reply to Nicolas IoossThis variable may be leaked in some error paths.
--- libselinux/src/label_db.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
libselinux/src/label_db.c +4 -1
@@ -281,9 +281,12 @@ db_init(const struct selinux_opt *opts, unsigned nopts,free (catalog);return NULL ; } -if (fstat (fileno (filp), &sb) <0 ) +if (fstat (fileno (filp), &sb) <0 ) { +free (catalog);return NULL ; + }if (!S_ISREG (sb.st_mode)) { +free (catalog); errno =EINVAL ;return NULL ; }
Signature · 1 line
2.11.0
PATCH 5/5 libselinux: fix argument order in get_default_context_with_rolelevel() doc
In reply to Nicolas Ioosslibselinux/src/get_context_list.c defines
get_default_context_with_rolelevel(user, role, level...
libselinux/utils/getdefaultcon.c uses
get_default_context_with_rolelevel(seuser, role, level...
but libselinux/include/selinux/get_context_list.h declares
get_default_context_with_rolelevel(user, level, role...
and libselinux/man/man3/get_ordered_context_list.3 follows this declaration.
Fix the header and the man page.
--- libselinux/include/selinux/get_context_list.h | 2 +- libselinux/man/man3/get_ordered_context_list.3 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
libselinux/include/selinux/get_context_list.h +1 -1
@@ -57,8 +57,8 @@ extern "C" {that has the specified role and level. If no reachable context exists for the user with that role, then return -1. */ int get_default_context_with_rolelevel (const char *user, -const char *level,const char *role, +const char *level,char * fromcon,char ** newcon);
libselinux/man/man3/get_ordered_context_list.3 +1 -1
@@ -17,7 +17,7 @@ get_ordered_context_list, get_ordered_context_list_with_level, get_default_conte .sp .BI "int get_default_context_with_role(const char *" user ", const char *" role ", char *" fromcon ", char **" newcon "); .sp -.BI "int get_default_context_with_rolelevel(const char *" user ", const char *" level ", const char *" role ", char *" fromcon ", char **" newcon "); +.BI "int get_default_context_with_rolelevel(const char *" user ", const char *" role ", const char *" level ", char *" fromcon ", char **" newcon "); .sp .BI "int query_user_context(char **" list ", char **" newcon ); .sp
Signature · 1 line
2.11.0
Stephen Smalley
AppliedRe: [PATCH 5/5] libselinux: fix argument order in get_default_context_with_rolelevel() doc
Quoted 8 lines · Nicolas Iooss
libselinux/src/get_context_list.cdefinesget_default_context_with_rolelevel(user, role, level...
libselinux/utils/getdefaultcon.cusesget_default_context_with_rolelevel(seuser, role, level...
Quoted 8 lines
but
libselinux/include/selinux/get_context_list.hdeclaresget_default_context_with_rolelevel(user, level, role...
and libselinux/man/man3/get_ordered_context_list.3 follows this declaration.
Fix the header and the man page.
Thanks, applied all 5 patches.
Quoted 43 lines
Signed-off-by Nicolas Iooss <[email protected]>---
libselinux/include/selinux/get_context_list.h | 2 +- libselinux/man/man3/get_ordered_context_list.3 | 2 +-2 files changed, 2 insertions(+), 2 deletions(-)libselinux/include/selinux/get_context_list.h +0
-0@@ -57,8 +57,8 @@ extern "C" {that has the specified role and level. If no reachable context exists
for the user with that role, then return -1. */
int get_default_context_with_rolelevel(const char *user,libselinux/include/selinux/get_context_list.h +0
-1- const char *level,const char *role,
libselinux/include/selinux/get_context_list.h +1
-0+ const char *level,char * fromcon, char ** newcon);
libselinux/man/man3/get_ordered_context_list.3 +0
-0@@ -17,7 +17,7 @@ get_ordered_context_list,
get_ordered_context_list_with_level,get_default_conte.sp
.BI "intget_default_context_with_role(const char *" user ", const char *" role ", char *" fromcon ", char **" newcon "); .sp
-.BI "int get_default_context_with_rolelevel(const char *" user ", const char *" level ", const char *" role ", char *" fromcon ", char **" newcon ");
+.BI "int get_default_context_with_rolelevel(const char *" user ", const char *" role ", const char *" level ", char *" fromcon ", char **" newcon ");
.sp
.BI "intquery_user_context(char **" list ", char **" newcon ); .sp