summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2017-01-16 11:42:29 +0300
committerJohn Johansen <john.johansen@canonical.com>2017-01-16 12:18:25 +0300
commit6e474e3063eae9767f219d83cf91d8360f63be0c (patch)
tree6931a7ccb797500f60ec9a6d7935b64b71806fdb /security
parentefeee83a7060c225fac5ac794e9c11183c267f81 (diff)
downloadlinux-6e474e3063eae9767f219d83cf91d8360f63be0c.tar.xz
apparmor: rename hname_tail to basename
Rename to the shorter and more familiar shell cmd name Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security')
-rw-r--r--security/apparmor/include/lib.h4
-rw-r--r--security/apparmor/lib.c2
-rw-r--r--security/apparmor/policy.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/security/apparmor/include/lib.h b/security/apparmor/include/lib.h
index 4ff09ed813b5..b5c16d3a7a18 100644
--- a/security/apparmor/include/lib.h
+++ b/security/apparmor/include/lib.h
@@ -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;
diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c
index fec78eecce0d..02203889c3c8 100644
--- a/security/apparmor/lib.c
+++ b/security/apparmor/lib.c
@@ -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);
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index 7fde5785005d..3b23960b8a5d 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -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;