From 669a4b96c374801faa137f43b4497b2ed6511104 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 6 Aug 2023 11:46:15 +0800 Subject: [PATCH] Update Android port * src/androidvfs.c (android_saf_tree_chmod): Repair file access permissions allowed within FLAGS. --- ChangeLog.android | 5 +++++ src/androidvfs.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog.android b/ChangeLog.android index d973dbcaf18..689482d2f1a 100644 --- a/ChangeLog.android +++ b/ChangeLog.android @@ -1,3 +1,8 @@ +2023-08-06 Po Lu + + * src/androidvfs.c (android_saf_tree_chmod): Repair file access + permissions allowed within FLAGS. + 2023-08-05 Po Lu * doc/lispref/commands.texi (Touchscreen Events): Fix typo. diff --git a/src/androidvfs.c b/src/androidvfs.c index 0d99116c75c..dc5097f463e 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -5101,17 +5101,17 @@ static int android_saf_tree_chmod (struct android_vnode *vnode, mode_t mode, int flags) { - /* Return EACCESS should MODE contain unusual bits besides S_IFDIR | - S_IRUSR | S_IXUSR. */ + /* Return EACCESS should MODE contain unusual bits besides the + standard file access permissions. */ - if (mode & ~(S_IFDIR | S_IRUSR | S_IXUSR)) + if (mode & ~0777) { errno = EACCES; return -1; } /* Otherwise, no further action is necessary, as SAF nodes already - pretend to be S_IFDIR | S_IRUSR | S_IXUSR. */ + pretend to be S_IRUSR | S_IWUSR. */ return 0; } -- 2.39.2