am 3b0988c5: Merge "Adjust sepolicy-analyze to reflect libsepol changes."

* commit '3b0988c59b3bd72113f88e482b0aa8f443d19074':
  Adjust sepolicy-analyze to reflect libsepol changes.
This commit is contained in:
dcashman 2015-01-13 23:20:25 +00:00 committed by Android Git Automerger
commit 6b111e4761

View file

@ -257,7 +257,7 @@ static int read_classperms(policydb_t *policydb, char **ptr, char *end,
node = calloc(1, sizeof *node);
if (!node)
goto err;
node->class = cls->s.value;
node->tclass = cls->s.value;
node->next = classperms;
classperms = node;
free(id);
@ -332,13 +332,13 @@ static int read_classperms(policydb_t *policydb, char **ptr, char *end,
}
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);
if (cls->comdatum && !perm)
perm = hashtab_search(cls->comdatum->permissions.table, id);
if (!perm) {
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;
}
node->data |= 1U << (perm->s.value - 1);