The following commit has been merged in the master branch:
commit 90dc4d8607d2eed2cd5e673c3ba5e3b5eb499cd3
Author: David Paleino <da...@debian.org>
Date:   Mon Mar 1 23:33:14 2010 +0100

    50_preferences_world_readable.dpatch: also fix the permissions on JOSM 
startup

diff --git a/debian/patches/50_preferences_world_readable.dpatch 
b/debian/patches/50_preferences_world_readable.dpatch
index 9df3834..721663f 100755
--- a/debian/patches/50_preferences_world_readable.dpatch
+++ b/debian/patches/50_preferences_world_readable.dpatch
@@ -7,14 +7,32 @@
 diff -urNad josm~/src/org/openstreetmap/josm/data/Preferences.java 
josm/src/org/openstreetmap/josm/data/Preferences.java
 --- josm~/src/org/openstreetmap/josm/data/Preferences.java
 +++ josm/src/org/openstreetmap/josm/data/Preferences.java
-@@ -346,6 +346,10 @@
+@@ -346,6 +346,14 @@
          File tmpFile = new File(prefFile + "_tmp");
          copyFile(tmpFile, prefFile);
          tmpFile.delete();
 +
-+        // Finally, make it owner-only-readable.
++        setCorrectPermissions();
++    }
++
++    public void setCorrectPermissions() throws IOException {
++        // Make it owner-only-readable.
 +        // FIXME: newest versions will use JDK 1.6, it has set*() functions.
-+        Runtime.getRuntime().exec("/bin/chmod 600 " + 
prefFile.getAbsolutePath());
++        Runtime.getRuntime().exec("/bin/chmod 600 " + 
getPreferenceFile().getAbsolutePath());
      }
  
      /**
+@@ -462,6 +470,13 @@
+                 System.err.println(tr("Warning: Failed to initialize 
preferences.Failed to reset preference file to default: {0}", 
getPreferenceFile()));
+             }
+         }
++
++        try {
++            setCorrectPermissions();
++        }
++        catch (IOException e) {
++            e.printStackTrace();
++        }
+     }
+ 
+     public final void resetToDefault(){

-- 
Java OpenStreetMap editor

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-grass-devel

Reply via email to