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

Commit b8491bb7 authored by Christopher Tate's avatar Christopher Tate
Browse files

Enforce DUMP permission on BackupManagerService's dump() method

The text of the dumped output can potentially include an email address;
we don't want random code to be able to read it.

Bug 5389201

Change-Id: If84886357a36b7015878e4d72017abba83b4c511
parent a44ad813
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -5596,6 +5596,16 @@ class BackupManagerService extends IBackupManager.Stub {
    }

    private void dumpInternal(PrintWriter pw) {
        if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
                != PackageManager.PERMISSION_GRANTED) {
            pw.println("Permission Denial: can't dump Backup Manager service from from pid="
                    + Binder.getCallingPid()
                    + ", uid=" + Binder.getCallingUid()
                    + " without permission "
                    + android.Manifest.permission.DUMP);
            return;
        }

        synchronized (mQueueLock) {
            pw.println("Backup Manager is " + (mEnabled ? "enabled" : "disabled")
                    + " / " + (!mProvisioned ? "not " : "") + "provisioned / "