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 { ...@@ -25,9 +25,11 @@ static struct {
void usage(char *arg0) 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 must be called on a policy file with a component and the appropriate arguments specified\n", arg0);
fprintf(stderr, "%s <policy-file>:\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(); analyze_components[i].usage();
} }
exit(1); exit(1);
...@@ -38,13 +40,13 @@ int main(int argc, char **argv) ...@@ -38,13 +40,13 @@ int main(int argc, char **argv)
char *policy; char *policy;
struct policy_file pf; struct policy_file pf;
policydb_t policydb; policydb_t policydb;
int rc; int rc, i;
if (argc < 3) if (argc < 3)
usage(argv[0]); usage(argv[0]);
policy = argv[1]; policy = argv[1];
if(load_policy(policy, &policydb, &pf)) if(load_policy(policy, &policydb, &pf))
exit(1); 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])) { if (!strcmp(analyze_components[i].key, argv[2])) {
rc = analyze_components[i].func(argc - 2, argv + 2, &policydb); rc = analyze_components[i].func(argc - 2, argv + 2, &policydb);
if (rc && USAGE_ERROR) { if (rc && USAGE_ERROR) {
...@@ -53,4 +55,7 @@ int main(int argc, char **argv) ...@@ -53,4 +55,7 @@ int main(int argc, char **argv)
} }
} }
usage(argv[0]); 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) { ...@@ -281,9 +281,6 @@ int typecmp_func (int argc, char **argv, policydb_t *policydb) {
case 'e': case 'e':
equiv = 1; equiv = 1;
break; break;
case 'w':
case 'z':
break;
default: default:
USAGE_ERROR = true; USAGE_ERROR = true;
return -1; return -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment