Lines Matching refs:hname
108 static const char *hname_tail(const char *hname) in hname_tail() argument
111 hname = strim((char *)hname); in hname_tail()
112 for (split = strstr(hname, "//"); split; split = strstr(hname, "//")) in hname_tail()
113 hname = split + 2; in hname_tail()
115 return hname; in hname_tail()
133 policy->hname = kmalloc(strlen(prefix) + strlen(name) + 3, in policy_init()
135 if (policy->hname) in policy_init()
136 sprintf(policy->hname, "%s//%s", prefix, name); in policy_init()
138 policy->hname = kstrdup(name, GFP_KERNEL); in policy_init()
139 if (!policy->hname) in policy_init()
142 policy->name = (char *)hname_tail(policy->hname); in policy_init()
169 kzfree(policy->hname); in policy_destroy()
262 return view->base.hname + strlen(curr->base.hname) + 2; in aa_ns_name()
306 kzfree(ns->base.hname); in alloc_namespace()
394 ns = alloc_namespace(root->base.hname, name); in aa_prepare_namespace()
646 struct aa_profile *aa_alloc_profile(const char *hname) in aa_alloc_profile() argument
660 if (!policy_init(&profile->base, NULL, hname)) in aa_alloc_profile()
695 name = kmalloc(strlen(parent->base.hname) + 2 + 7 + 8, GFP_KERNEL); in aa_new_null_profile()
698 sprintf(name, "%s//null-%x", parent->base.hname, uniq); in aa_new_null_profile()
790 const char *hname) in __lookup_parent() argument
798 for (split = strstr(hname, "//"); split;) { in __lookup_parent()
799 profile = __strn_find_child(&policy->profiles, hname, in __lookup_parent()
800 split - hname); in __lookup_parent()
804 hname = split + 2; in __lookup_parent()
805 split = strstr(hname, "//"); in __lookup_parent()
824 const char *hname) in __lookup_profile() argument
829 for (split = strstr(hname, "//"); split;) { in __lookup_profile()
830 profile = __strn_find_child(&base->profiles, hname, in __lookup_profile()
831 split - hname); in __lookup_profile()
836 hname = split + 2; in __lookup_profile()
837 split = strstr(hname, "//"); in __lookup_profile()
840 profile = __find_child(&base->profiles, hname); in __lookup_profile()
852 struct aa_profile *aa_lookup_profile(struct aa_namespace *ns, const char *hname) in aa_lookup_profile() argument
858 profile = __lookup_profile(&ns->base, hname); in aa_lookup_profile()
863 if (!profile && strcmp(hname, "unconfined") == 0) in aa_lookup_profile()
944 const char *base = hname_tail(profile->base.hname); in __list_lookup_parent()
945 long len = base - profile->base.hname; in __list_lookup_parent()
956 if (strncmp(ent->new->base.hname, profile->base.hname, len) == in __list_lookup_parent()
957 0 && ent->new->base.hname[len] == 0) in __list_lookup_parent()
1040 static int __lookup_replace(struct aa_namespace *ns, const char *hname, in __lookup_replace() argument
1044 *p = aa_get_profile(__lookup_profile(&ns->base, hname)); in __lookup_replace()
1096 name = ent->new->base.hname; in aa_replace_profiles()
1097 error = __lookup_replace(ns, ent->new->base.hname, noreplace, in aa_replace_profiles()
1117 policy = __lookup_parent(ns, ent->new->base.hname); in aa_replace_profiles()
1124 name = ent->new->base.hname; in aa_replace_profiles()
1283 name = profile->base.hname; in aa_remove_profiles()