From bcb06e3244808e2ced0de2a39a348a7ddb7c54f2 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 26 Mar 2019 14:54:59 -0700 Subject: xabspath: use O_PATH. SELinux on Android is unhappy if you try to read "/": avc: denied { read } for name="/" dev="dm-3" ino=2 scontext=u:r:hal_dumpstate_impl:s0 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0 O_PATH seems more intention-revealing anyway. --- lib/xwrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xwrap.c b/lib/xwrap.c index a8214e57..2e2ccbc1 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -521,7 +521,7 @@ void xstat(char *path, struct stat *st) char *xabspath(char *path, int exact) { struct string_list *todo, *done = 0; - int try = 9999, dirfd = open("/", 0), missing = 0; + int try = 9999, dirfd = open("/", O_PATH), missing = 0; char *ret; // If this isn't an absolute path, start with cwd. -- cgit v1.2.3