Lines Matching refs:hname

258 struct aa_profile *aa_alloc_profile(const char *hname, struct aa_proxy *proxy,  in aa_alloc_profile()  argument
269 if (!aa_policy_init(&profile->base, NULL, hname, gfp)) in aa_alloc_profile()
283 profile->label.hname = profile->base.hname; in aa_alloc_profile()
363 const char *hname) in __lookup_parent() argument
371 for (split = strstr(hname, "//"); split;) { in __lookup_parent()
372 profile = __strn_find_child(&policy->profiles, hname, in __lookup_parent()
373 split - hname); in __lookup_parent()
377 hname = split + 2; in __lookup_parent()
378 split = strstr(hname, "//"); in __lookup_parent()
398 const char *hname, size_t n) in __lookupn_profile() argument
403 for (split = strnstr(hname, "//", n); split; in __lookupn_profile()
404 split = strnstr(hname, "//", n)) { in __lookupn_profile()
405 profile = __strn_find_child(&base->profiles, hname, in __lookupn_profile()
406 split - hname); in __lookupn_profile()
411 n -= split + 2 - hname; in __lookupn_profile()
412 hname = split + 2; in __lookupn_profile()
416 return __strn_find_child(&base->profiles, hname, n); in __lookupn_profile()
421 const char *hname) in __lookup_profile() argument
423 return __lookupn_profile(base, hname, strlen(hname)); in __lookup_profile()
434 struct aa_profile *aa_lookupn_profile(struct aa_ns *ns, const char *hname, in aa_lookupn_profile() argument
441 profile = __lookupn_profile(&ns->base, hname, n); in aa_lookupn_profile()
446 if (!profile && strncmp(hname, "unconfined", n) == 0) in aa_lookupn_profile()
453 struct aa_profile *aa_lookup_profile(struct aa_ns *ns, const char *hname) in aa_lookup_profile() argument
455 return aa_lookupn_profile(ns, hname, strlen(hname)); in aa_lookup_profile()
514 name = kmalloc(strlen(parent->base.hname) + 8 + strlen(base), in aa_new_null_profile()
517 sprintf(name, "%s//null-%s", parent->base.hname, base); in aa_new_null_profile()
523 name = kmalloc(strlen(parent->base.hname) + 2 + 7 + 8, gfp); in aa_new_null_profile()
526 sprintf(name, "%s//null-%x", parent->base.hname, in aa_new_null_profile()
709 const char *base = basename(profile->base.hname); in __list_lookup_parent()
710 long len = base - profile->base.hname; in __list_lookup_parent()
721 if (strncmp(ent->new->base.hname, profile->base.hname, len) == in __list_lookup_parent()
722 0 && ent->new->base.hname[len] == 0) in __list_lookup_parent()
798 static int __lookup_replace(struct aa_ns *ns, const char *hname, in __lookup_replace() argument
802 *p = aa_get_profile(__lookup_profile(&ns->base, hname)); in __lookup_replace()
816 aa_put_str(new->base.hname); in share_name()
817 aa_get_str(old->base.hname); in share_name()
818 new->base.hname = old->base.hname; in share_name()
820 new->label.hname = old->label.hname; in share_name()
934 error = __lookup_replace(ns, ent->new->base.hname, in aa_replace_profiles()
955 policy = __lookup_parent(ns, ent->new->base.hname); in aa_replace_profiles()
1008 audit_policy(label, op, ns_name, ent->new->base.hname, in aa_replace_profiles()
1021 audit_policy(label, op, ns_name, ent->new->base.hname, NULL, in aa_replace_profiles()
1059 audit_policy(label, op, ns_name, ent ? ent->new->base.hname : NULL, in aa_replace_profiles()
1070 audit_policy(label, op, ns_name, tmp->new->base.hname, info, in aa_replace_profiles()
1141 name = profile->base.hname; in aa_remove_profiles()