Lines Matching defs:hname

59  *   is referred to as an hname (hierarchical).
325 * @hname: name of the profile (NOT NULL)
331 struct aa_profile *aa_alloc_profile(const char *hname, struct aa_proxy *proxy,
342 if (!aa_policy_init(&profile->base, NULL, hname, gfp))
364 profile->label.hname = profile->base.hname;
431 * __lookup_parent - lookup the parent of a profile of name @hname
433 * @hname: hierarchical profile name to find parent of (NOT NULL)
436 * that matches hname does not need to exist, in general this
444 const char *hname)
452 for (split = strstr(hname, "//"); split;) {
453 profile = __strn_find_child(&policy->profiles, hname,
454 split - hname);
458 hname = split + 2;
459 split = strstr(hname, "//");
469 * @hname: hierarchical profile name to find parent of (NOT NULL)
478 const char *hname,
486 AA_BUG(!hname);
490 for (split = strstr(hname, "//"); split;) {
492 profile = __strn_find_child(&policy->profiles, hname,
493 split - hname);
495 const char *name = kstrndup(hname, split - hname,
507 hname = split + 2;
508 split = strstr(hname, "//");
516 * __lookupn_profile - lookup the profile matching @hname
518 * @hname: hierarchical profile name (NOT NULL)
519 * @n: length of @hname
528 const char *hname, size_t n)
533 for (split = strnstr(hname, "//", n); split;
534 split = strnstr(hname, "//", n)) {
535 profile = __strn_find_child(&base->profiles, hname,
536 split - hname);
541 n -= split + 2 - hname;
542 hname = split + 2;
546 return __strn_find_child(&base->profiles, hname, n);
551 const char *hname)
553 return __lookupn_profile(base, hname, strlen(hname));
559 * @hname: name to do lookup on. Does not contain namespace prefix (NOT NULL)
560 * @n: size of @hname
564 struct aa_profile *aa_lookupn_profile(struct aa_ns *ns, const char *hname,
571 profile = __lookupn_profile(&ns->base, hname, n);
576 if (!profile && strncmp(hname, "unconfined", n) == 0)
583 struct aa_profile *aa_lookup_profile(struct aa_ns *ns, const char *hname)
585 return aa_lookupn_profile(ns, hname, strlen(hname));
672 name = kmalloc(strlen(parent->base.hname) + 8 + strlen(base),
675 sprintf(name, "%s//null-%s", parent->base.hname, base);
681 name = kmalloc(strlen(parent->base.hname) + 2 + 7 + 8, gfp);
684 sprintf(name, "%s//null-%x", parent->base.hname,
909 const char *base = basename(profile->base.hname);
910 long len = base - profile->base.hname;
921 if (strncmp(ent->new->base.hname, profile->base.hname, len) ==
922 0 && ent->new->base.hname[len] == 0)
961 /* TODO: update hname of inherited children */
990 * @hname: name of profile to lookup
997 static int __lookup_replace(struct aa_ns *ns, const char *hname,
1001 *p = aa_get_profile(__lookup_profile(&ns->base, hname));
1015 aa_put_str(new->base.hname);
1016 aa_get_str(old->base.hname);
1017 new->base.hname = old->base.hname;
1019 new->label.hname = old->label.hname;
1137 error = __lookup_replace(ns, ent->new->base.hname,
1159 policy = __lookup_parent(ns, ent->new->base.hname);
1177 ent->new->base.hname,
1230 audit_policy(label, op, ns_name, ent->new->base.hname,
1243 audit_policy(label, op, ns_name, ent->new->base.hname, NULL,
1282 audit_policy(label, op, ns_name, ent ? ent->new->base.hname : NULL,
1293 audit_policy(label, op, ns_name, tmp->new->base.hname, info,
1364 name = profile->base.hname;