[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#277044: "--restrict-read-only /" should permit subpaths

Package: rdiff-backup
Version: 0.13.4-3

"rdiff-backup --server --restrict-read-only /tmp" permits backups of 
/tmp/foo -- this is expected according to the docs.

"rdiff-backup --server --restrict-read-only /" does not permit backups of 
any subdirectory -- this looks like an oversight, the docs imply it should 
work.  the patch below fixes this behaviour.


--- rdiff-backup-0.13.4/rdiff_backup/Security.py.dg1	2004-06-04 09:59:22.000000000 -0700
+++ rdiff-backup-0.13.4/rdiff_backup/Security.py	2004-10-17 23:52:14.000000000 -0700
@@ -195,6 +195,7 @@
 	"""Require rpath not to step outside retricted directory"""
 	if Globals.restrict_path and rpath.conn is Globals.local_connection:
 		normalized, restrict = rpath.normalize().path, Globals.restrict_path
+		if restrict == "/": return
 		components = normalized.split("/")
 		# 3 cases for restricted dir /usr/foo:  /var, /usr/foobar, /usr/foo/..
 		if (not normalized.startswith(restrict) or

Reply to: