about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-07-14 01:50:50 +0200
committerhut <hut@lepus.uberspace.de>2015-07-14 01:50:50 +0200
commit738385757680d17a33557a5ff8779cb7314097b2 (patch)
treeee11903bb5202cf642f4ff56d73164a72d34059e
parentb428c6ba320461accc09d10cd65edad69c7ce9d1 (diff)
parent2922f61c1c02803c82e725469764ecd3471ee7a6 (diff)
downloadranger-738385757680d17a33557a5ff8779cb7314097b2.tar.gz
Merge branch 'bookmarks_fix' of https://github.com/igoyak/ranger
-rw-r--r--ranger/container/bookmarks.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py
index 5f163e89..cbb95864 100644
--- a/ranger/container/bookmarks.py
+++ b/ranger/container/bookmarks.py
@@ -156,6 +156,12 @@ class Bookmarks(object):
                         pass
 
             f.close()
+            old_perms = os.stat(self.path)
+            try:
+                os.chown(self.path+".new", old_perms.st_uid, old_perms.st_gid)
+                os.chmod(self.path+".new", old_perms.st_mode)
+            except OSError:
+                pass
             os.rename(self.path+".new", self.path)
         self._update_mtime()