author: Christoph Hellwig <hch@lst.de> 2020-07-22 11:14:02 +0200
committer: Christoph Hellwig <hch@lst.de> 2020-07-31 08:17:53 +0200
commit: eb9d7d390e51108b4c6a9a7993ed9be92548c8f7
parent: 1097742efc643ffc667c5c6684635b2663145a7d
Commit Summary:
Diffstat:
1 file changed, 12 insertions, 0 deletions
diff --git a/fs/init.c b/fs/init.c
index a66032d128b6..6d9af40d2897 100644
--- a/fs/init.c
+++ b/fs/init.c
@@ -109,6 +109,19 @@ int __init init_chmod(const char *filename, umode_t mode)
return error;
}
+int __init init_eaccess(const char *filename)
+{
+ struct path path;
+ int error;
+
+ error = kern_path(filename, LOOKUP_FOLLOW, &path);
+ if (error)
+ return error;
+ error = inode_permission(d_inode(path.dentry), MAY_ACCESS);
+ path_put(&path);
+ return error;
+}
+
int __init init_unlink(const char *pathname)
{
return do_unlinkat(AT_FDCWD, getname_kernel(pathname));