Skip to content
Snippets Groups Projects
Commit a66d8d23 authored by Dan Albert's avatar Dan Albert Committed by Android Git Automerger
Browse files

am 460c3f16: resolved conflicts in merge of 3fa92bed to lmp-mr1-dev-plus-aosp

* commit '460c3f16':
  Accept command-line input for neverallow-check.
parents 8c041147 460c3f16
No related branches found
No related tags found
No related merge requests found
......@@ -25,9 +25,11 @@ static struct {
void usage(char *arg0)
{
int i;
fprintf(stderr, "%s must be called on a policy file with a component and the appropriate arguments specified\n", arg0);
fprintf(stderr, "%s <policy-file>:\n", arg0);
for(int i = 0; i < NUM_COMPONENTS; i++) {
for(i = 0; i < NUM_COMPONENTS; i++) {
analyze_components[i].usage();
}
exit(1);
......@@ -38,13 +40,13 @@ int main(int argc, char **argv)
char *policy;
struct policy_file pf;
policydb_t policydb;
int rc;
int rc, i;
if (argc < 3)
usage(argv[0]);
policy = argv[1];
if(load_policy(policy, &policydb, &pf))
exit(1);
for(int i = 0; i < NUM_COMPONENTS; i++) {
for(i = 0; i < NUM_COMPONENTS; i++) {
if (!strcmp(analyze_components[i].key, argv[2])) {
rc = analyze_components[i].func(argc - 2, argv + 2, &policydb);
if (rc && USAGE_ERROR) {
......@@ -53,4 +55,7 @@ int main(int argc, char **argv)
}
}
usage(argv[0]);
// will never be called due to exit() call in usage
exit(1);
}
......@@ -281,9 +281,6 @@ int typecmp_func (int argc, char **argv, policydb_t *policydb) {
case 'e':
equiv = 1;
break;
case 'w':
case 'z':
break;
default:
USAGE_ERROR = true;
return -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment