Skip to content

Commit 6e474e3

Browse files
committed
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>
1 parent efeee83 commit 6e474e3

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎security/apparmor/include/lib.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ struct aa_policy {
130130
};
131131

132132
/**
133-
* hname_tail - find the last component of an hname
133+
* basename - find the last component of an hname
134134
* @name: hname to find the base profile name component of (NOT NULL)
135135
*
136136
* Returns: the tail (base profile name) name component of an hname
137137
*/
138-
static inline const char *hname_tail(const char *hname)
138+
static inline const char *basename(const char *hname)
139139
{
140140
char *split;
141141

‎security/apparmor/lib.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ bool aa_policy_init(struct aa_policy *policy, const char *prefix,
184184
if (!policy->hname)
185185
return 0;
186186
/* base.name is a substring of fqname */
187-
policy->name = (char *)hname_tail(policy->hname);
187+
policy->name = (char *)basename(policy->hname);
188188
INIT_LIST_HEAD(&policy->list);
189189
INIT_LIST_HEAD(&policy->profiles);
190190

‎security/apparmor/policy.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ bool aa_may_manage_policy(int op)
617617
static struct aa_profile *__list_lookup_parent(struct list_head *lh,
618618
struct aa_profile *profile)
619619
{
620-
const char *base = hname_tail(profile->base.hname);
620+
const char *base = basename(profile->base.hname);
621621
long len = base - profile->base.hname;
622622
struct aa_load_ent *ent;
623623

0 commit comments

Comments
 (0)