apparmor: rename hname_tail to basename
authorJohn Johansen <john.johansen@canonical.com>
Mon, 16 Jan 2017 08:42:29 +0000 (00:42 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Mon, 16 Jan 2017 09:18:25 +0000 (01:18 -0800)
Rename to the shorter and more familiar shell cmd name

Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/include/lib.h
security/apparmor/lib.c
security/apparmor/policy.c

index 4ff09ed813b59f92c72166da9793258e7b4c145a..b5c16d3a7a189dce5167ffd2a329d01e4ba9cb3c 100644 (file)
@@ -130,12 +130,12 @@ struct aa_policy {
 };
 
 /**
- * hname_tail - find the last component of an hname
+ * basename - find the last component of an hname
  * @name: hname to find the base profile name component of  (NOT NULL)
  *
  * Returns: the tail (base profile name) name component of an hname
  */
-static inline const char *hname_tail(const char *hname)
+static inline const char *basename(const char *hname)
 {
        char *split;
 
index fec78eecce0dd325c955985cca4df5f03ec932e1..02203889c3c812d7ee4969a1c8fc66fdc0ee0933 100644 (file)
@@ -184,7 +184,7 @@ bool aa_policy_init(struct aa_policy *policy, const char *prefix,
        if (!policy->hname)
                return 0;
        /* base.name is a substring of fqname */
-       policy->name = (char *)hname_tail(policy->hname);
+       policy->name = (char *)basename(policy->hname);
        INIT_LIST_HEAD(&policy->list);
        INIT_LIST_HEAD(&policy->profiles);
 
index 7fde5785005dd0ecb6d8ba8450e4773225f99acb..3b23960b8a5d218a20b0220f8f2517845fba7a9c 100644 (file)
@@ -617,7 +617,7 @@ bool aa_may_manage_policy(int op)
 static struct aa_profile *__list_lookup_parent(struct list_head *lh,
                                               struct aa_profile *profile)
 {
-       const char *base = hname_tail(profile->base.hname);
+       const char *base = basename(profile->base.hname);
        long len = base - profile->base.hname;
        struct aa_load_ent *ent;