summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rdiff-backup/CHANGELOG2
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py7
2 files changed, 8 insertions, 1 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index e7af956..3746d0d 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,8 @@
New in v1.0.5 (????/??/??)
--------------------------
+Set symlink permissions properly. (Patch from Andrew Ferguson.)
+
Fix a traceback due to an off-by-1 error in "--remove-older-than nB".
Fix a security violation when restoring from a remote repository.
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index ac24a31..6727f9a 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -95,7 +95,12 @@ def copy(rpin, rpout, compress = 0):
if rpin.isreg(): copy_reg_file(rpin, rpout, compress)
elif rpin.isdir(): rpout.mkdir()
- elif rpin.issym(): rpout.symlink(rpin.readlink())
+ elif rpin.issym():
+ # some systems support permissions for symlinks, but
+ # only by setting at creation via the umask
+ os.umask(0777 - rpin.getperms())
+ rpout.symlink(rpin.readlink())
+ os.umask(077) # restore rdiff-backup standard umask
elif rpin.ischardev():
major, minor = rpin.getdevnums()
rpout.makedev("c", major, minor)