Lines Matching defs:hname

59  *   is referred to as an hname (hierarchical).
252 * @hname: name of the profile (NOT NULL)
257 struct aa_profile *aa_alloc_profile(const char *hname, struct aa_proxy *proxy,
268 if (!aa_policy_init(&profile->base, NULL, hname, gfp))
282 profile->label.hname = profile->base.hname;
349 * __lookup_parent - lookup the parent of a profile of name @hname
351 * @hname: hierarchical profile name to find parent of (NOT NULL)
354 * that matches hname does not need to exist, in general this
362 const char *hname)
370 for (split = strstr(hname, "//"); split;) {
371 profile = __strn_find_child(&policy->profiles, hname,
372 split - hname);
376 hname = split + 2;
377 split = strstr(hname, "//");
385 * __lookupn_profile - lookup the profile matching @hname
387 * @hname: hierarchical profile name (NOT NULL)
388 * @n: length of @hname
397 const char *hname, size_t n)
402 for (split = strnstr(hname, "//", n); split;
403 split = strnstr(hname, "//", n)) {
404 profile = __strn_find_child(&base->profiles, hname,
405 split - hname);
410 n -= split + 2 - hname;
411 hname = split + 2;
415 return __strn_find_child(&base->profiles, hname, n);
420 const char *hname)
422 return __lookupn_profile(base, hname, strlen(hname));
428 * @hname: name to do lookup on. Does not contain namespace prefix (NOT NULL)
429 * @n: size of @hname
433 struct aa_profile *aa_lookupn_profile(struct aa_ns *ns, const char *hname,
440 profile = __lookupn_profile(&ns->base, hname, n);
445 if (!profile && strncmp(hname, "unconfined", n) == 0)
452 struct aa_profile *aa_lookup_profile(struct aa_ns *ns, const char *hname)
454 return aa_lookupn_profile(ns, hname, strlen(hname));
513 name = kmalloc(strlen(parent->base.hname) + 8 + strlen(base),
516 sprintf(name, "%s//null-%s", parent->base.hname, base);
522 name = kmalloc(strlen(parent->base.hname) + 2 + 7 + 8, gfp);
525 sprintf(name, "%s//null-%x", parent->base.hname,
708 const char *base = basename(profile->base.hname);
709 long len = base - profile->base.hname;
720 if (strncmp(ent->new->base.hname, profile->base.hname, len) ==
721 0 && ent->new->base.hname[len] == 0)
761 /* TODO: update hname of inherited children */
790 * @hname - name of profile to lookup
797 static int __lookup_replace(struct aa_ns *ns, const char *hname,
801 *p = aa_get_profile(__lookup_profile(&ns->base, hname));
815 aa_put_str(new->base.hname);
816 aa_get_str(old->base.hname);
817 new->base.hname = old->base.hname;
819 new->label.hname = old->label.hname;
933 error = __lookup_replace(ns, ent->new->base.hname,
954 policy = __lookup_parent(ns, ent->new->base.hname);
1007 audit_policy(label, op, ns_name, ent->new->base.hname,
1020 audit_policy(label, op, ns_name, ent->new->base.hname, NULL,
1059 audit_policy(label, op, ns_name, ent ? ent->new->base.hname : NULL,
1070 audit_policy(label, op, ns_name, tmp->new->base.hname, info,
1141 name = profile->base.hname;