From 93aff590963db63aacc1448e4f3dcb5914460f38 Mon Sep 17 00:00:00 2001 From: bmax Date: Sat, 25 May 2024 18:17:22 +0800 Subject: [PATCH] make user hdr --- kernel/Makefile | 5 +++-- kernel/patch/android/userd.c | 4 ++-- user/.gitignore | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 3dc9fdc9..0443cb27 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -68,8 +68,9 @@ ${TARGET}.elf: ${OBJS} .PHONY: hdr hdr: - cp -Rf patch/include/uapi ../user - cp -f include/preset.h ../tools + cp -Rf patch/include/uapi ../user/ + cp -f ../version ../user/ + cp -f include/preset.h ../tools/ .PHONY: clean clean: diff --git a/kernel/patch/android/userd.c b/kernel/patch/android/userd.c index 5bddc495..3ebb758e 100644 --- a/kernel/patch/android/userd.c +++ b/kernel/patch/android/userd.c @@ -253,8 +253,8 @@ static void before_openat(hook_fargs4_t *args, void *udata) const char __user *filename = (typeof(filename))syscall_argn(args, 1); char buf[32]; - int rc = compat_strncpy_from_user(buf, filename, sizeof(buf)); - if (IS_ERR(rc)) return; + long rc = compat_strncpy_from_user(buf, filename, sizeof(buf)); + if (rc <= 0) return; if (strcmp(ORIGIN_RC_FILE, buf)) return; replaced = 1; diff --git a/user/.gitignore b/user/.gitignore index 94b9893e..f9663c85 100644 --- a/user/.gitignore +++ b/user/.gitignore @@ -1 +1,2 @@ -uapi \ No newline at end of file +uapi +version \ No newline at end of file