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

Commit 87ae08de authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

cmfm: fix ensure read, write and execute checks in java console



Change-Id: I03e6117f6f660c46aa9df9ff8ebf7c602badb40a
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent 4639b409
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import com.cyanogenmod.filemanager.commands.shell.ResolveLinkCommand;
import com.cyanogenmod.filemanager.console.Console;
import com.cyanogenmod.filemanager.console.ExecutionException;
import com.cyanogenmod.filemanager.console.InsufficientPermissionsException;
import com.cyanogenmod.filemanager.console.java.JavaConsole;
import com.cyanogenmod.filemanager.model.AID;
import com.cyanogenmod.filemanager.model.BlockDevice;
import com.cyanogenmod.filemanager.model.CharacterDevice;
@@ -1135,6 +1136,11 @@ public final class FileHelper {
                // Should have access
                return;
            }
            if (console instanceof JavaConsole &&
                    StorageHelper.isPathInStorageVolume(fso.getFullPath())) {
                // Java console runs in chrooted environment, and sdcard are always readable
                return;
            }
            Identity identity = console.getIdentity();
            if (identity == null) {
                throw new InsufficientPermissionsException(executable);
@@ -1190,6 +1196,11 @@ public final class FileHelper {
                // Should have access
                return;
            }
            if (console instanceof JavaConsole &&
                    StorageHelper.isPathInStorageVolume(fso.getFullPath())) {
                // Java console runs in chrooted environment, and sdcard are always writeable
                return;
            }
            Identity identity = console.getIdentity();
            if (identity == null) {
                throw new InsufficientPermissionsException(executable);
@@ -1245,6 +1256,11 @@ public final class FileHelper {
                // Should have access
                return;
            }
            if (console instanceof JavaConsole &&
                    StorageHelper.isPathInStorageVolume(fso.getFullPath())) {
                // Java console runs in chrooted environment, and sdcard are never executable
                throw new InsufficientPermissionsException(executable);
            }
            Identity identity = console.getIdentity();
            if (identity == null) {
                throw new InsufficientPermissionsException(executable);