Lines Matching defs:hname

59  *   is referred to as an hname (hierarchical).
288 * @hname: name of the profile (NOT NULL)
294 struct aa_profile *aa_alloc_profile(const char *hname, struct aa_proxy *proxy,
305 if (!aa_policy_init(&profile->base, NULL, hname, gfp))
327 profile->label.hname = profile->base.hname;
394 * __lookup_parent - lookup the parent of a profile of name @hname
396 * @hname: hierarchical profile name to find parent of (NOT NULL)
399 * that matches hname does not need to exist, in general this
407 const char *hname)
415 for (split = strstr(hname, "//"); split;) {
416 profile = __strn_find_child(&policy->profiles, hname,
417 split - hname);
421 hname = split + 2;
422 split = strstr(hname, "//");
432 * @hname: hierarchical profile name to find parent of (NOT NULL)
441 const char *hname,
449 AA_BUG(!hname);
453 for (split = strstr(hname, "//"); split;) {
455 profile = __strn_find_child(&policy->profiles, hname,
456 split - hname);
458 const char *name = kstrndup(hname, split - hname,
470 hname = split + 2;
471 split = strstr(hname, "//");
479 * __lookupn_profile - lookup the profile matching @hname
481 * @hname: hierarchical profile name (NOT NULL)
482 * @n: length of @hname
491 const char *hname, size_t n)
496 for (split = strnstr(hname, "//", n); split;
497 split = strnstr(hname, "//", n)) {
498 profile = __strn_find_child(&base->profiles, hname,
499 split - hname);
504 n -= split + 2 - hname;
505 hname = split + 2;
509 return __strn_find_child(&base->profiles, hname, n);
514 const char *hname)
516 return __lookupn_profile(base, hname, strlen(hname));
522 * @hname: name to do lookup on. Does not contain namespace prefix (NOT NULL)
523 * @n: size of @hname
527 struct aa_profile *aa_lookupn_profile(struct aa_ns *ns, const char *hname,
534 profile = __lookupn_profile(&ns->base, hname, n);
539 if (!profile && strncmp(hname, "unconfined", n) == 0)
546 struct aa_profile *aa_lookup_profile(struct aa_ns *ns, const char *hname)
548 return aa_lookupn_profile(ns, hname, strlen(hname));
648 name = kmalloc(strlen(parent->base.hname) + 8 + strlen(base),
651 sprintf(name, "%s//null-%s", parent->base.hname, base);
657 name = kmalloc(strlen(parent->base.hname) + 2 + 7 + 8, gfp);
660 sprintf(name, "%s//null-%x", parent->base.hname,
885 const char *base = basename(profile->base.hname);
886 long len = base - profile->base.hname;
897 if (strncmp(ent->new->base.hname, profile->base.hname, len) ==
898 0 && ent->new->base.hname[len] == 0)
937 /* TODO: update hname of inherited children */
966 * @hname: name of profile to lookup
973 static int __lookup_replace(struct aa_ns *ns, const char *hname,
977 *p = aa_get_profile(__lookup_profile(&ns->base, hname));
991 aa_put_str(new->base.hname);
992 aa_get_str(old->base.hname);
993 new->base.hname = old->base.hname;
995 new->label.hname = old->label.hname;
1113 error = __lookup_replace(ns, ent->new->base.hname,
1135 policy = __lookup_parent(ns, ent->new->base.hname);
1153 ent->new->base.hname,
1206 audit_policy(label, op, ns_name, ent->new->base.hname,
1219 audit_policy(label, op, ns_name, ent->new->base.hname, NULL,
1258 audit_policy(label, op, ns_name, ent ? ent->new->base.hname : NULL,
1269 audit_policy(label, op, ns_name, tmp->new->base.hname, info,
1340 name = profile->base.hname;