Rename trust function to attr, to be more generic
This commit is contained in:
parent
370951ab67
commit
1a1c1fd0da
@ -348,7 +348,7 @@ int load_policy(char *filename, policydb_t *policydb, struct policy_file *pf) {
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *policy = NULL, *source = NULL, *target = NULL, *class = NULL, *perm = NULL;
|
char *policy = NULL, *source = NULL, *target = NULL, *class = NULL, *perm = NULL;
|
||||||
char *fcon = NULL, *outfile = NULL, *permissive = NULL, *trust = NULL, *filetrans = NULL;
|
char *fcon = NULL, *outfile = NULL, *permissive = NULL, *attr = NULL, *filetrans = NULL;
|
||||||
policydb_t policydb;
|
policydb_t policydb;
|
||||||
struct policy_file pf, outpf;
|
struct policy_file pf, outpf;
|
||||||
sidtab_t sidtab;
|
sidtab_t sidtab;
|
||||||
@ -358,7 +358,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
{"trust", required_argument, NULL, 'a'},
|
{"attr", required_argument, NULL, 'a'},
|
||||||
{"source", required_argument, NULL, 's'},
|
{"source", required_argument, NULL, 's'},
|
||||||
{"target", required_argument, NULL, 't'},
|
{"target", required_argument, NULL, 't'},
|
||||||
{"class", required_argument, NULL, 'c'},
|
{"class", required_argument, NULL, 'c'},
|
||||||
@ -375,7 +375,7 @@ int main(int argc, char **argv)
|
|||||||
while ((ch = getopt_long(argc, argv, "a:f:g:s:t:c:p:P:o:Z:z:", long_options, NULL)) != -1) {
|
while ((ch = getopt_long(argc, argv, "a:f:g:s:t:c:p:P:o:Z:z:", long_options, NULL)) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'a':
|
case 'a':
|
||||||
trust = optarg;
|
attr = optarg;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
fcon = optarg;
|
fcon = optarg;
|
||||||
@ -414,7 +414,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((!source || !target || !class || !perm) && !permissive && !fcon && !trust &&!filetrans) || !policy)
|
if (((!source || !target || !class || !perm) && !permissive && !fcon && !attr &&!filetrans) || !policy)
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
|
|
||||||
if(!outfile)
|
if(!outfile)
|
||||||
@ -448,9 +448,8 @@ int main(int argc, char **argv)
|
|||||||
add_file_transition(source, fcon, target, class, filetrans, &policydb);
|
add_file_transition(source, fcon, target, class, filetrans, &policydb);
|
||||||
} else if(fcon) {
|
} else if(fcon) {
|
||||||
add_transition(source, fcon, target, class, &policydb);
|
add_transition(source, fcon, target, class, &policydb);
|
||||||
} else if(trust) {
|
} else if(attr) {
|
||||||
add_type(trust, "mlstrustedobject", &policydb);
|
add_type(source, attr, &policydb);
|
||||||
add_type(trust, "mlstrustedsubject", &policydb);
|
|
||||||
} else {
|
} else {
|
||||||
create_domain(source, &policydb);
|
create_domain(source, &policydb);
|
||||||
if (add_rule(source, target, class, perm, &policydb)) {
|
if (add_rule(source, target, class, perm, &policydb)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user