[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rdiff-backup-users] Write-once read-many problem
From: |
Sheldon Hearn |
Subject: |
Re: [rdiff-backup-users] Write-once read-many problem |
Date: |
Wed, 20 Jul 2005 12:19:29 +0200 |
User-agent: |
KMail/1.8 |
On Wednesday 20 July 2005 11:39, Sheldon Hearn wrote:
> Anyone actually know what rdiff-backup thinks its doing here? If I
> could find the wayward chmod/chown in the source, I'd just hack it
> out, since it's bogus for my application, and probably bogus in any
> restore.
I've taken a look at the code in restore.py, and I don't get it.
If we're not root on the server during a restore operation, we try to
change permissions to ensure readability? Either we can read an object
or we can't. If we can't, it's _highly_ unlikely that we'll be able to
change permissions on it anyway.
The attached patch fixes rdiff-backup for my admittedly unusual
application. Be warned, I have no idea why the code I removed was put
there in the first place. Just because it doesn't make sense to me
doesn't mean it had no purpose.
So I'll just carry this patch on my central server (it's not required on
restore clients), and we can all pretend this didn't happen until the
next person tries to use rdiff-backup to restore from a read-only
location. :-)
Ciao,
Sheldon.
--- rdiff_backup/restore.py.orig 2005-07-20 12:14:08.000000000 +0200
+++ rdiff_backup/restore.py 2005-07-20 12:11:52.000000000 +0200
@@ -307,8 +307,6 @@
"""Initialize CachedRF, self.rf_list variable"""
self.root_rf = root_rf
self.rf_list = [] # list should filled in index order
- if Globals.process_uid != 0:
- self.perm_changer = PermissionChanger(root_rf.mirror_rp)
def list_rfs_in_cache(self, index):
"""Used for debugging, return indicies of cache rfs for
printing"""
@@ -324,7 +322,6 @@
if not self.add_rfs(index): return None
rf = self.rf_list[0]
if rf.index == index:
- if Globals.process_uid != 0:
self.perm_changer(index)
return rf
elif rf.index > index:
# Try to add earlier indicies. But if first is
@@ -353,7 +350,6 @@
"""
if not index: return self.root_rf
parent_index = index[:-1]
- if Globals.process_uid != 0: self.perm_changer(parent_index)
temp_rf =
RestoreFile(self.root_rf.mirror_rp.new_index(parent_index),
self.root_rf.inc_rp.new_index(parent_index), [])
new_rfs = list(temp_rf.yield_sub_rfs())
@@ -364,8 +360,7 @@
return 1
def close(self):
- """Finish remaining rps in PermissionChanger"""
- if Globals.process_uid != 0: self.perm_changer.finish()
+ return 0
class RestoreFile:
pgpOzeWh9T5JJ.pgp
Description: PGP signature
- [rdiff-backup-users] Write-once read-many problem, Sheldon Hearn, 2005/07/18
- Re: [rdiff-backup-users] Write-once read-many problem, dean gaudet, 2005/07/18
- Re: [rdiff-backup-users] Write-once read-many problem, Sheldon Hearn, 2005/07/19
- Re: [rdiff-backup-users] Write-once read-many problem, Thomas Bettler, 2005/07/19
- Re: [rdiff-backup-users] Write-once read-many problem, Sheldon Hearn, 2005/07/20
- Re: [rdiff-backup-users] Write-once read-many problem,
Sheldon Hearn <=
- Re: [rdiff-backup-users] Write-once read-many problem, dean gaudet, 2005/07/20
- Re: [rdiff-backup-users] Write-once read-many problem, Maarten Bezemer, 2005/07/20
- Re: [rdiff-backup-users] Write-once read-many problem, Sheldon Hearn, 2005/07/21
- Re: [rdiff-backup-users] Write-once read-many problem, Maarten Bezemer, 2005/07/20
- Re: [rdiff-backup-users] Write-once read-many problem, Sheldon Hearn, 2005/07/20
- Re: [rdiff-backup-users] Write-once read-many problem, dean gaudet, 2005/07/19
- Re: [rdiff-backup-users] Write-once read-many problem, Thomas Bettler, 2005/07/20