Skip to content
Snippets Groups Projects
Commit 0de2b45f authored by dcashman's avatar dcashman
Browse files

Adjust sepolicy-analyze to reflect libsepol changes.

Commit dc0ab516f11d8e2c413315e733e25a41ba468e4f changed the libsepol
structures on which sepolicy-analyze relies so that it could be compiled
as a C++ library.  Reflect this change in sepolicy-analyze.

Change-Id: I7da601767c3a4ebed7274e33304d8b589a9115fe
parent 754f5ea7
No related branches found
No related tags found
No related merge requests found
...@@ -257,7 +257,7 @@ static int read_classperms(policydb_t *policydb, char **ptr, char *end, ...@@ -257,7 +257,7 @@ static int read_classperms(policydb_t *policydb, char **ptr, char *end,
node = calloc(1, sizeof *node); node = calloc(1, sizeof *node);
if (!node) if (!node)
goto err; goto err;
node->class = cls->s.value; node->tclass = cls->s.value;
node->next = classperms; node->next = classperms;
classperms = node; classperms = node;
free(id); free(id);
...@@ -332,13 +332,13 @@ static int read_classperms(policydb_t *policydb, char **ptr, char *end, ...@@ -332,13 +332,13 @@ static int read_classperms(policydb_t *policydb, char **ptr, char *end,
} }
for (node = classperms; node; node = node->next) { for (node = classperms; node; node = node->next) {
cls = policydb->class_val_to_struct[node->class-1]; cls = policydb->class_val_to_struct[node->tclass-1];
perm = hashtab_search(cls->permissions.table, id); perm = hashtab_search(cls->permissions.table, id);
if (cls->comdatum && !perm) if (cls->comdatum && !perm)
perm = hashtab_search(cls->comdatum->permissions.table, id); perm = hashtab_search(cls->comdatum->permissions.table, id);
if (!perm) { if (!perm) {
if (warn) if (warn)
fprintf(stderr, "Warning! Permission %s used in neverallow undefined in class %s in policy being checked.\n", id, policydb->p_class_val_to_name[node->class-1]); fprintf(stderr, "Warning! Permission %s used in neverallow undefined in class %s in policy being checked.\n", id, policydb->p_class_val_to_name[node->tclass-1]);
continue; continue;
} }
node->data |= 1U << (perm->s.value - 1); node->data |= 1U << (perm->s.value - 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment