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

Update aliases so that they apply properly to profile names.

Instead of updating the profile name, allow a profile to have multiple
alternate names.  Aliases are now added as alternate names and matched
through the xmatch dfa.
This commit is contained in:
John Johansen
2010-02-12 13:49:58 -08:00
parent eafddd3cea
commit ee00b0cea2
3 changed files with 27 additions and 3 deletions

View File

@@ -161,11 +161,17 @@ static void process_name(const void *nodep, VISIT value, int __unused level)
len = strlen((*t)->from);
if (cod->name && strncmp((*t)->from, cod->name, len) == 0) {
struct alt_name *alt;
char *new = do_alias(*t, cod->name);
if (!new)
return;
free(cod->name);
cod->name = new;
/* aliases create alternate names */
alt = calloc(1, sizeof(struct alt_name));
if (!alt)
return;
alt->name = new;
alt->next = cod->altnames;
cod->altnames = alt;
}
}