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

Commit 61695ffc authored by Christopher Tate's avatar Christopher Tate
Browse files

Make sure settings writes are permission checked correctly

The last bit of undoing the earlier tangle around query results having
observers under the calling user's identity.  We do *not* want to drop
calling identity in the call() processing; we want the table-based
permission checks at the point of the underlying db operations to be
performed against that identity.

Bug 7265610

Change-Id: Ie0c9331ebd0918262a0a32b5b03b876fc2a92ca3
parent dd2f15a5
Loading
Loading
Loading
Loading
+45 −52
Original line number Original line Diff line number Diff line
@@ -556,10 +556,6 @@ public class SettingsProvider extends ContentProvider {
            }
            }
        }
        }


        // Okay, permission checks have cleared.  Reset to our own identity so we can
        // manipulate all users' data with impunity.
        long oldId = Binder.clearCallingIdentity();
        try {
        // Note: we assume that get/put operations for moved-to-global names have already
        // Note: we assume that get/put operations for moved-to-global names have already
        // been directed to the new location on the caller side (otherwise we'd fix them
        // been directed to the new location on the caller side (otherwise we'd fix them
        // up here).
        // up here).
@@ -607,9 +603,6 @@ public class SettingsProvider extends ContentProvider {
        } else {
        } else {
            Slog.w(TAG, "call() with invalid method: " + method);
            Slog.w(TAG, "call() with invalid method: " + method);
        }
        }
        } finally {
            Binder.restoreCallingIdentity(oldId);
        }


        return null;
        return null;
    }
    }