OSDN Git Service

Secure file moving issue fix
authorroot <srinivas.p031@gmail.com>
Wed, 7 Oct 2015 15:34:10 +0000 (21:04 +0530)
committerGerrit Code Review <gerrit@cyanogenmod.org>
Thu, 15 Oct 2015 23:12:31 +0000 (16:12 -0700)
Change-Id: I684124bb32747a39d772b41c48d62c4c236b3ed2

src/com/cyanogenmod/filemanager/commands/secure/MoveCommand.java [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 0a7e09a..0ee0a7e
@@ -113,6 +113,13 @@ public class MoveCommand extends Program implements MoveExecutable {
                 if (!d.exists()) {
                     throw new ExecutionException("Failed to rename file or directory", ex);
                 }
+                if (s.exists() && d.exists()) {
+                    if (!FileHelper.deleteFileOrFolder(s)) {
+                        if (isTrace()) {
+                            Log.v(TAG, "File copied successfully but not deleted"); //$NON-NLS-1$
+                        }
+                    }
+                }
             }
         }