2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 14:25:52 +00:00

add basic handling of profile namespaces

This commit is contained in:
John Johansen
2007-11-16 09:18:48 +00:00
parent 11d8181d0d
commit a4721bd02d
9 changed files with 160 additions and 24 deletions

View File

@@ -67,6 +67,7 @@ char *subdomainbase = NULL;
char *profilename;
char *match_string = NULL;
int regex_type = AARE_DFA;
char *profile_namespace = NULL;
extern int current_lineno;
@@ -89,6 +90,7 @@ struct option long_options[] = {
{"stdout", 0, 0, 'S'},
{"match-string", 1, 0, 'm'},
{"quiet", 0, 0, 'q'},
{"namespace", 1, 0, 'n'},
{NULL, 0, 0, 0},
};
@@ -119,6 +121,7 @@ static void display_usage(char *command)
"-f n, --subdomainfs n Set location of apparmor filesystem\n"
"-S, --stdout Write output to stdout\n"
"-m n, --match-string n Use only match features n\n"
"-n n, --namespace n Set Namespace for the profile\n"
"-q, --quiet Don't emit warnings\n", command);
}
@@ -149,7 +152,7 @@ static int process_args(int argc, char *argv[])
int count = 0;
option = OPTION_ADD;
while ((c = getopt_long(argc, argv, "adf:hrRvpI:b:CNSm:q", long_options, &o)) != -1)
while ((c = getopt_long(argc, argv, "adf:hrRvpI:b:CNSm:qn:", long_options, &o)) != -1)
{
switch (c) {
case 0:
@@ -215,6 +218,9 @@ static int process_args(int argc, char *argv[])
case 'q':
conf_quiet = 1;
break;
case 'n':
profile_namespace = strdup(optarg);
break;
default:
display_usage(progname);
exit(0);