Lines Matching refs:hname

329 struct aa_profile *aa_alloc_profile(const char *hname, struct aa_proxy *proxy,  in aa_alloc_profile()  argument
342 if (!aa_policy_init(&profile->base, NULL, hname, gfp)) in aa_alloc_profile()
362 profile->label.hname = profile->base.hname; in aa_alloc_profile()
478 const char *hname) in __lookup_parent() argument
486 for (split = strstr(hname, "//"); split;) { in __lookup_parent()
487 profile = __strn_find_child(&policy->profiles, hname, in __lookup_parent()
488 split - hname); in __lookup_parent()
492 hname = split + 2; in __lookup_parent()
493 split = strstr(hname, "//"); in __lookup_parent()
512 const char *hname, in __create_missing_ancestors() argument
520 AA_BUG(!hname); in __create_missing_ancestors()
524 for (split = strstr(hname, "//"); split;) { in __create_missing_ancestors()
526 profile = __strn_find_child(&policy->profiles, hname, in __create_missing_ancestors()
527 split - hname); in __create_missing_ancestors()
529 const char *name = kstrndup(hname, split - hname, in __create_missing_ancestors()
541 hname = split + 2; in __create_missing_ancestors()
542 split = strstr(hname, "//"); in __create_missing_ancestors()
562 const char *hname, size_t n) in __lookupn_profile() argument
567 for (split = strnstr(hname, "//", n); split; in __lookupn_profile()
568 split = strnstr(hname, "//", n)) { in __lookupn_profile()
569 profile = __strn_find_child(&base->profiles, hname, in __lookupn_profile()
570 split - hname); in __lookupn_profile()
575 n -= split + 2 - hname; in __lookupn_profile()
576 hname = split + 2; in __lookupn_profile()
580 return __strn_find_child(&base->profiles, hname, n); in __lookupn_profile()
585 const char *hname) in __lookup_profile() argument
587 return __lookupn_profile(base, hname, strlen(hname)); in __lookup_profile()
598 struct aa_profile *aa_lookupn_profile(struct aa_ns *ns, const char *hname, in aa_lookupn_profile() argument
605 profile = __lookupn_profile(&ns->base, hname, n); in aa_lookupn_profile()
610 if (!profile && strncmp(hname, "unconfined", n) == 0) in aa_lookupn_profile()
704 name = kmalloc(strlen(parent->base.hname) + 8 + strlen(base), in aa_new_learning_profile()
707 sprintf(name, "%s//null-%s", parent->base.hname, base); in aa_new_learning_profile()
713 name = kmalloc(strlen(parent->base.hname) + 2 + 7 + 8, gfp); in aa_new_learning_profile()
716 sprintf(name, "%s//null-%x", parent->base.hname, in aa_new_learning_profile()
941 const char *base = basename(profile->base.hname); in __list_lookup_parent()
942 long len = base - profile->base.hname; in __list_lookup_parent()
953 if (strncmp(ent->new->base.hname, profile->base.hname, len) == in __list_lookup_parent()
954 0 && ent->new->base.hname[len] == 0) in __list_lookup_parent()
1029 static int __lookup_replace(struct aa_ns *ns, const char *hname, in __lookup_replace() argument
1033 *p = aa_get_profile(__lookup_profile(&ns->base, hname)); in __lookup_replace()
1047 aa_put_str(new->base.hname); in share_name()
1048 aa_get_str(old->base.hname); in share_name()
1049 new->base.hname = old->base.hname; in share_name()
1051 new->label.hname = old->label.hname; in share_name()
1169 error = __lookup_replace(ns, ent->new->base.hname, in aa_replace_profiles()
1191 policy = __lookup_parent(ns, ent->new->base.hname); in aa_replace_profiles()
1209 ent->new->base.hname, in aa_replace_profiles()
1262 audit_policy(label, op, ns_name, ent->new->base.hname, in aa_replace_profiles()
1275 audit_policy(label, op, ns_name, ent->new->base.hname, NULL, in aa_replace_profiles()
1314 audit_policy(label, op, ns_name, ent ? ent->new->base.hname : NULL, in aa_replace_profiles()
1325 audit_policy(label, op, ns_name, tmp->new->base.hname, info, in aa_replace_profiles()
1396 name = profile->base.hname; in aa_remove_profiles()