selinux: specialize symtab insert and search functions

This encapsulates symtab a little better and will help with further
refactoring later.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
Ondrej Mosnacek
2020-07-08 13:24:45 +02:00
committed by Paul Moore
parent 2c3d8dfece
commit 237389e301
7 changed files with 69 additions and 56 deletions

View File

@@ -200,7 +200,7 @@ static int bool_isvalid(struct cond_bool_datum *b)
return 1;
}
int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp)
int cond_read_bool(struct policydb *p, struct symtab *s, void *fp)
{
char *key = NULL;
struct cond_bool_datum *booldatum;
@@ -235,7 +235,7 @@ int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp)
if (rc)
goto err;
key[len] = '\0';
rc = hashtab_insert(h, key, booldatum);
rc = symtab_insert(s, key, booldatum);
if (rc)
goto err;