From b028ea0e27df8a435c6f1888a7d6e68a5623eafd Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 7 Aug 2024 09:17:57 +0800 Subject: [PATCH] Prevent accesses to /content files without a GUI connection * src/androidvfs.c (android_content_name): Hide all subdirectories when `android_init_gui' is not set. (cherry picked from commit 679f7ccc49f6300681309029f4e58cffe3e9ff1a) --- src/androidvfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/androidvfs.c b/src/androidvfs.c index bb855099c77..14da8eed37e 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -2599,9 +2599,10 @@ android_content_name (struct android_vnode *vnode, char *name, component_end++; /* Now, find out if the first component is a special vnode; if so, - call its root lookup function with the rest of NAME there. */ + call its root lookup function with the rest of NAME there. What is + more, content files are inaccessible in the absence of a GUI. */ - if (api < 19) + if (api < 19 || !android_init_gui) i = 3; else if (api < 21) i = 1; -- 2.39.2