]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fs: Export in_group_or_capable()
authorYouling Tang <tangyouling@kylinos.cn>
Thu, 20 Jun 2024 03:23:33 +0000 (11:23 +0800)
committerChristian Brauner <brauner@kernel.org>
Tue, 25 Jun 2024 09:15:48 +0000 (11:15 +0200)
Export in_group_or_capable() as a VFS helper function.

Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
Link: https://lore.kernel.org/r/20240620032335.147136-1-youling.tang@linux.dev
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/attr.c
fs/inode.c
include/linux/fs.h

index 960a310581ebb9e00d77b323ad812a2fc34ada1b..825007d5cda4330e1dc78c962144cbb46ae2d051 100644 (file)
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -17,8 +17,6 @@
 #include <linux/filelock.h>
 #include <linux/security.h>
 
-#include "internal.h"
-
 /**
  * setattr_should_drop_sgid - determine whether the setgid bit needs to be
  *                            removed
index 3a41f83a4ba5598536d57b8a5230f34da66621aa..e0815acc5abba9fa2be2425d775c62c30f07a528 100644 (file)
@@ -2538,6 +2538,7 @@ bool in_group_or_capable(struct mnt_idmap *idmap,
                return true;
        return false;
 }
+EXPORT_SYMBOL(in_group_or_capable);
 
 /**
  * mode_strip_sgid - handle the sgid bit for non-directories
index bfc1e6407bf680028a0adee39a0f9f5431251a96..942cb11dba961543e9697321173de150f9917bed 100644 (file)
@@ -1942,6 +1942,8 @@ void inode_init_owner(struct mnt_idmap *idmap, struct inode *inode,
 extern bool may_open_dev(const struct path *path);
 umode_t mode_strip_sgid(struct mnt_idmap *idmap,
                        const struct inode *dir, umode_t mode);
+bool in_group_or_capable(struct mnt_idmap *idmap,
+                        const struct inode *inode, vfsgid_t vfsgid);
 
 /*
  * This is the "filldir" function type, used by readdir() to let