default is used as a keyword for defining default group permissions. Having "default" as a group name (with double quotes "), parsing is successfull. Howerver, using default without double quotes, parsing fails. This patch modifies parsing rule and lex for default group name without double quotes.
Tested on:
default {
perm {
task {
uid = root;
gid = rgel6610;
fperm = 770;
}
admin {
uid = root;
gid = root;
dperm = 775;
fperm = 744;
}
}
}
group default {
cpuset {
cpuset.mems = 0;
cpuset.cpus = 0;
}
}
Signed-off-by: Jan Chaloupka <jchaloup@redhat.com>
Acked-by: Jan Safranek <jsafrane@redhat.com>
"group" {return GROUP;}
"namespace" {return NAMESPACE;}
"template" {return TEMPLATE;}
-"default" {return DEFAULT;}
+"default" {yylval.name = strdup(yytext); return DEFAULT;}
[a-zA-Z0-9_\-\/\.\,\%\@\\]+ {yylval.name = strdup(yytext); return ID;}
\"[^"]*\" {yylval.name = strdup(yytext+1); yylval.name[strlen(yylval.name)-1] = '\0'; return ID; }
. {return yytext[0];}
int val;
struct cgroup_dictionary *values;
}
-%type <name> ID
+%type <name> ID DEFAULT
%type <val> mountvalue_conf mount task_namevalue_conf admin_namevalue_conf
-%type <val> admin_conf task_conf task_or_admin group_conf group start
+%type <val> admin_conf task_conf task_or_admin group_conf group start group_name
%type <val> namespace namespace_conf default default_conf
%type <values> namevalue_conf
%type <val> template template_conf
}
;
-group : GROUP ID '{' group_conf '}'
+group : GROUP group_name '{' group_conf '}'
{
$$ = $4;
if ($$) {
}
;
+group_name
+ : ID
+ {
+ $$ = $1;
+ }
+ | DEFAULT
+ {
+ $$ = $1;
+ }
+
group_conf
: ID '{' namevalue_conf '}'
{