am 5835ac9e: Merge "Only check caller when deriving permissions." into klp-dev
* commit '5835ac9e31aea910adb6b9d2de1d63df771df45b':
Only check caller when deriving permissions.
diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c
index 330d555..9a1dd17 100644
--- a/sdcard/sdcard.c
+++ b/sdcard/sdcard.c
@@ -488,6 +488,11 @@
/* Return if the calling UID holds sdcard_rw. */
static bool get_caller_has_rw_locked(struct fuse* fuse, const struct fuse_in_header *hdr) {
+ /* No additional permissions enforcement */
+ if (fuse->derive == DERIVE_NONE) {
+ return true;
+ }
+
appid_t appid = multiuser_get_app_id(hdr->uid);
return hashmapContainsKey(fuse->appid_with_rw, (void*) appid);
}