We can now have a list of permissions instead of just one permission, coma separated

This commit is contained in:
Pierre-Hugues Husson 2015-11-11 14:02:15 +01:00
parent 8473caf5a6
commit c011bccc45

View File

@ -455,11 +455,15 @@ int main(int argc, char **argv)
} else if(noaudit) { } else if(noaudit) {
add_rule(source, target, class, perm, AVTAB_AUDITDENY, &policydb); add_rule(source, target, class, perm, AVTAB_AUDITDENY, &policydb);
} else { } else {
create_domain(source, &policydb); char *saveptr = NULL;
if (add_rule(source, target, class, perm, AVTAB_ALLOWED, &policydb)) {
fprintf(stderr, "Could not add rule\n"); char *p = strtok_r(perm, ",", &saveptr);
return 1; do {
} if (add_rule(source, target, class, p, AVTAB_ALLOWED, &policydb)) {
fprintf(stderr, "Could not add rule\n");
return 1;
}
} while( (p = strtok_r(NULL, ",", &saveptr)) != NULL);
} }
fp = fopen(outfile, "w"); fp = fopen(outfile, "w");