Drop auto backport path_umount (#124)
Since https://github.com/backslashxx/KernelSU/commit/4f8943a and https://github.com/rsuntk/KernelSU/commit/0eab5ae , so auto backport `path_umount` is no longer needed.
This commit is contained in:
@@ -123,50 +123,7 @@ ifeq ($(shell grep -q "CONFIG_KDP_CRED" $(srctree)/kernel/cred.c; echo $$?),0)
|
||||
ccflags-y += -DSAMSUNG_UH_DRIVER_EXIST
|
||||
endif
|
||||
|
||||
ccflags-y += -DKSU_UMOUNT
|
||||
|
||||
ifneq ($(shell grep -Eq "^static int can_umount" $(srctree)/fs/namespace.c; echo $$?),0)
|
||||
$(info -- SukiSU compat: adding function 'static int can_umount(const struct path *path, int flags);' to $(srctree)/fs/namespace.c)
|
||||
CAN_UMOUNT = static int can_umount(const struct path *path, int flags)\n\
|
||||
{\n\t\
|
||||
struct mount *mnt = real_mount(path->mnt);\n\t\
|
||||
if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW))\n\t\t\
|
||||
return -EINVAL;\n\t\
|
||||
if (!may_mount())\n\t\t\
|
||||
return -EPERM;\n\t\
|
||||
if (path->dentry != path->mnt->mnt_root)\n\t\t\
|
||||
return -EINVAL;\n\t\
|
||||
if (!check_mnt(mnt))\n\t\t\
|
||||
return -EINVAL;\n\t\
|
||||
if (mnt->mnt.mnt_flags & MNT_LOCKED)\n\t\t\
|
||||
return -EINVAL;\n\t\
|
||||
if (flags & MNT_FORCE && !capable(CAP_SYS_ADMIN))\n\t\t\
|
||||
return -EPERM;\n\t\
|
||||
return 0;\n\
|
||||
}\n
|
||||
$(shell sed -i '/^static bool is_mnt_ns_file/i $(CAN_UMOUNT)' $(srctree)/fs/namespace.c;)
|
||||
endif
|
||||
|
||||
ifneq ($(shell grep -Eq "^int path_umount" $(srctree)/fs/namespace.c; echo $$?),0)
|
||||
$(info -- SukiSU compat: adding function 'int path_umount(struct path *path, int flags);' to $(srctree)/fs/namespace.c)
|
||||
PATH_UMOUNT = int path_umount(struct path *path, int flags)\n\
|
||||
{\n\t\
|
||||
struct mount *mnt = real_mount(path->mnt);\n\t\
|
||||
int ret;\n\t\
|
||||
ret = can_umount(path, flags);\n\t\
|
||||
if (!ret)\n\t\t\
|
||||
ret = do_umount(mnt, flags);\n\t\
|
||||
dput(path->dentry);\n\t\
|
||||
mntput_no_expire(mnt);\n\t\
|
||||
return ret;\n\
|
||||
}\n
|
||||
$(shell sed -i '/^static bool is_mnt_ns_file/i $(PATH_UMOUNT)' $(srctree)/fs/namespace.c;)
|
||||
endif
|
||||
|
||||
ifneq ($(shell grep -Eq "^int path_umount" $(srctree)/fs/internal.h; echo $$?),0)
|
||||
$(shell sed -i '/^extern void __init mnt_init/a int path_umount(struct path *path, int flags);' $(srctree)/fs/internal.h;)
|
||||
$(info -- SukiSU compat: adding 'int path_umount(struct path *path, int flags);' to $(srctree)/fs/internal.h)
|
||||
endif
|
||||
#ccflags-y += -DKSU_UMOUNT
|
||||
|
||||
# Do checks before compile
|
||||
ifeq ($(shell grep -q "int\s\+\path_umount" $(srctree)/fs/namespace.c; echo $$?),0)
|
||||
|
||||
Reference in New Issue
Block a user