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

allow specifying link permissions as a pair

This commit is contained in:
John Johansen
2007-11-16 09:37:31 +00:00
parent 398102afa8
commit 4ce25448af
6 changed files with 65 additions and 12 deletions

View File

@@ -512,8 +512,12 @@ static int process_dfa_entry(aare_ruleset_t *dfarules, struct cod_entry *entry)
/* add the pair rule */
char lbuf[PATH_MAX + 8];
int perms = AA_LINK_BITS & entry->mode;
perms |= LINK_TO_LINK_SUBSET(perms);
sprintf(lbuf, "%s///**", entry->name);
if (entry->link_name) {
sprintf(lbuf, "%s//%s", entry->name, entry->link_name);
} else {
perms |= LINK_TO_LINK_SUBSET(perms);
sprintf(lbuf, "%s///**", entry->name);
}
ptype = convert_aaregex_to_pcre(lbuf, 0, tbuf, PATH_MAX + 8);
if (ptype == ePatternInvalid)
return FALSE;