aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2014-11-21 01:01:12 +0100
committerJorge Ruesga <jorge@ruesga.com>2014-11-21 01:01:12 +0100
commit87ae08deeeb52aaba256d887be369d214439ef62 (patch)
tree859fac3698bd6c96e6446dcb12e7694bb4900aca
parent4639b409e7a0f96dba48295606da618fefcebd33 (diff)
downloadandroid_packages_apps_CMFileManager-87ae08deeeb52aaba256d887be369d214439ef62.tar.gz
android_packages_apps_CMFileManager-87ae08deeeb52aaba256d887be369d214439ef62.tar.bz2
android_packages_apps_CMFileManager-87ae08deeeb52aaba256d887be369d214439ef62.zip
cmfm: fix ensure read, write and execute checks in java console
Change-Id: I03e6117f6f660c46aa9df9ff8ebf7c602badb40a Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
-rw-r--r--src/com/cyanogenmod/filemanager/util/FileHelper.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/filemanager/util/FileHelper.java b/src/com/cyanogenmod/filemanager/util/FileHelper.java
index 3b43aa83..d49d31f1 100644
--- a/src/com/cyanogenmod/filemanager/util/FileHelper.java
+++ b/src/com/cyanogenmod/filemanager/util/FileHelper.java
@@ -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);