[PATCH] apparmor: make __aa_path_perm() static

Subsystems: apparmor security module, security subsystem, the rest

STALE1475d

2 messages, 2 authors, 2022-09-24 · open the first message on its own page

[PATCH] apparmor: make __aa_path_perm() static

From: Xiu Jianfeng <xiujianfeng@huawei.com>
Date: 2022-09-14 07:49:51

Make __aa_path_perm() static as it's only used inside apparmor/file.c.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 security/apparmor/file.c         | 6 +++---
 security/apparmor/include/file.h | 3 ---
 2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/security/apparmor/file.c b/security/apparmor/file.c
index e1b7e93602e4..14f7d7ef3f54 100644
--- a/security/apparmor/file.c
+++ b/security/apparmor/file.c
@@ -265,9 +265,9 @@ unsigned int aa_str_perms(struct aa_dfa *dfa, unsigned int start,
 	return state;
 }
 
-int __aa_path_perm(const char *op, struct aa_profile *profile, const char *name,
-		   u32 request, struct path_cond *cond, int flags,
-		   struct aa_perms *perms)
+static int __aa_path_perm(const char *op, struct aa_profile *profile, const char *name,
+			  u32 request, struct path_cond *cond, int flags,
+			  struct aa_perms *perms)
 {
 	int e = 0;
 
diff --git a/security/apparmor/include/file.h b/security/apparmor/include/file.h
index 029cb20e322d..17dca3502230 100644
--- a/security/apparmor/include/file.h
+++ b/security/apparmor/include/file.h
@@ -189,9 +189,6 @@ unsigned int aa_str_perms(struct aa_dfa *dfa, unsigned int start,
 			  const char *name, struct path_cond *cond,
 			  struct aa_perms *perms);
 
-int __aa_path_perm(const char *op, struct aa_profile *profile,
-		   const char *name, u32 request, struct path_cond *cond,
-		   int flags, struct aa_perms *perms);
 int aa_path_perm(const char *op, struct aa_label *label,
 		 const struct path *path, int flags, u32 request,
 		 struct path_cond *cond);
-- 
2.17.1

Re: [PATCH] apparmor: make __aa_path_perm() static

From: John Johansen <john.johansen@canonical.com>
Date: 2022-09-24 09:21:25

On 9/14/22 00:46, Xiu Jianfeng wrote:
Make __aa_path_perm() static as it's only used inside apparmor/file.c.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Acked-by: John Johansen <john.johansen@canonical.com>
quoted hunk
---
  security/apparmor/file.c         | 6 +++---
  security/apparmor/include/file.h | 3 ---
  2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/security/apparmor/file.c b/security/apparmor/file.c
index e1b7e93602e4..14f7d7ef3f54 100644
--- a/security/apparmor/file.c
+++ b/security/apparmor/file.c
@@ -265,9 +265,9 @@ unsigned int aa_str_perms(struct aa_dfa *dfa, unsigned int start,
  	return state;
  }
  
-int __aa_path_perm(const char *op, struct aa_profile *profile, const char *name,
-		   u32 request, struct path_cond *cond, int flags,
-		   struct aa_perms *perms)
+static int __aa_path_perm(const char *op, struct aa_profile *profile, const char *name,
+			  u32 request, struct path_cond *cond, int flags,
+			  struct aa_perms *perms)
  {
  	int e = 0;
  
diff --git a/security/apparmor/include/file.h b/security/apparmor/include/file.h
index 029cb20e322d..17dca3502230 100644
--- a/security/apparmor/include/file.h
+++ b/security/apparmor/include/file.h
@@ -189,9 +189,6 @@ unsigned int aa_str_perms(struct aa_dfa *dfa, unsigned int start,
  			  const char *name, struct path_cond *cond,
  			  struct aa_perms *perms);
  
-int __aa_path_perm(const char *op, struct aa_profile *profile,
-		   const char *name, u32 request, struct path_cond *cond,
-		   int flags, struct aa_perms *perms);
  int aa_path_perm(const char *op, struct aa_label *label,
  		 const struct path *path, int flags, u32 request,
  		 struct path_cond *cond);

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help