OSDN Git Service

Add deletion of files in res for security enhancement.
authorRandy Baumgarte <randy@fbn.cx>
Wed, 12 Jan 2011 12:24:25 +0000 (07:24 -0500)
committerRandy Baumgarte <randy@fbn.cx>
Sun, 30 Jan 2011 13:36:01 +0000 (08:36 -0500)
src/cx/fbn/nevernote/NeverNote.java

index 988ae34..c503d64 100644 (file)
@@ -986,6 +986,12 @@ public class NeverNote extends QMainWindow{
                if (decryptOnShutdown) {
                        decryptOnShutdown();
                }
                if (decryptOnShutdown) {
                        decryptOnShutdown();
                }
+               try {
+                       Global.getFileManager().purgeResDirectory(false);
+               } catch (InitializationException e) {
+                       System.out.println(tr("Empty res directory purge failed"));
+                       e.printStackTrace();
+               }
                logger.log(logger.HIGH, "Leaving NeverNote.closeEvent");
        }
 
                logger.log(logger.HIGH, "Leaving NeverNote.closeEvent");
        }
 
@@ -5415,7 +5421,7 @@ public class NeverNote extends QMainWindow{
                
        ImportData noteReader = new ImportData(conn, false);
        String fileName = fd.selectedFiles().get(0);
                
        ImportData noteReader = new ImportData(conn, false);
        String fileName = fd.selectedFiles().get(0);
-       saveLastPath.substring(0,fileName.lastIndexOf("/"));
+//     saveLastPath.substring(0,fileName.lastIndexOf("/"));
 
        if (!fileName.endsWith(".nnex"))
                fileName = fileName +".nnex";
 
        if (!fileName.endsWith(".nnex"))
                fileName = fileName +".nnex";