Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5835ac9e authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Only check caller when deriving permissions." into klp-dev

parents 5856fd89 39ff0ae0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -488,6 +488,11 @@ static void derive_permissions_locked(struct fuse* fuse, struct node *parent,

/* 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);
}