mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
parser: Properly parse named transition targets
https://launchpad.net/bugs/1540666 Reuse the new parse_label() function to initialize named_transition structs so that transition targets, when used with change_profile, are properly seperated into a profile namespace and profile name. Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Acked-by: John Johansen <john.johansen@canonical.com> Bug: https://launchpad.net/bugs/1379874
This commit is contained in:
@@ -615,6 +615,19 @@ void parse_label(char **ns, char **name, const char *label)
|
||||
*name = _name;
|
||||
}
|
||||
|
||||
void parse_named_transition_target(struct named_transition *nt,
|
||||
const char *target)
|
||||
{
|
||||
memset(nt, 0, sizeof(*nt));
|
||||
if (!target) {
|
||||
/* Return with nt->present set to 0 (thanks to the memset) */
|
||||
return;
|
||||
}
|
||||
|
||||
parse_label(&nt->ns, &nt->name, target);
|
||||
nt->present = 1;
|
||||
}
|
||||
|
||||
struct cod_entry *new_entry(char *ns, char *id, int mode, char *link_id)
|
||||
{
|
||||
struct cod_entry *entry = NULL;
|
||||
|
Reference in New Issue
Block a user