Re: [rdiff-backup-users] rdiff-backup error: Mac OS X - Linux

2007-02-28 Thread Andrew Ferguson
Corey Puffalt wrote:
 As you can see I'm running the backup as root but on the remote side
 (where the backup data is being stored) I'm just a normal user...

Yup, that's the issue and clearly a bug. It's different than the one
Frederic reported, but they both have to do with permission errors that
the OS ignores when the user is root.

Andre

-- 
Andrew Ferguson - [EMAIL PROTECTED]



___
rdiff-backup-users mailing list at rdiff-backup-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki


Re: [rdiff-backup-users] BUG: directory with no permission

2007-02-28 Thread Andrew Ferguson
Frederic Bastien wrote:
 Hi,
 
 I have found a bug. I'm a Java/C/C++ programmer, so it will be easier 
 for you to correct it them it. I use rdiff-backup 1.1.9. I have 
 simplified the step to reproduce it like this:
 
 #mkdir t
 #chmod a-rxw t
 #rdiff-backup t t2

Ok, this quick and dirty patch fixes the case you have run into.
However, if rdiff-backup is going to support root source/target
directories that are unreadable, a more extensive patch is needed to
handle --restore, --list-increments, etc.

Does anyone think this patch is on the right track? Suggestions?

Andrew

-- 
Andrew Ferguson - [EMAIL PROTECTED]

--- rdiff-backup-cvs/rdiff_backup/Main.py   2007-01-29 21:00:34.0 
-0500
+++ rdiff-backup-local/rdiff_backup/Main.py 2007-02-28 17:50:35.0 
-0500
@@ -286,12 +286,16 @@
elif action == verify: Verify(rps[0])
else: raise AssertionError(Unknown action  + action)
 
-def cleanup():
+def cleanup(rps):
Do any last minute cleaning before exiting
+   global rpin_perms
Log(Cleaning up, 6)
if ErrorLog.isopen(): ErrorLog.close()
Log.close_logfile()
if not Globals.server: SetConnections.CloseConnections()
+   if rpin_perms is not None:
+   rps[0].chmod(rpin_perms)
+   rps[1].chmod(rpin_perms)
 
 def error_check_Main(arglist):
Run Main on arglist, suppressing stack trace for routine errors
@@ -308,6 +312,8 @@
 
 def Main(arglist):
Start everything up!
+   global rpin_perms
+   rpin_perms = None
parse_cmdlineoptions(arglist)
check_action()
cmdpairs = SetConnections.get_cmd_pairs(args, remote_schema, remote_cmd)
@@ -316,7 +322,7 @@
final_set_action(rps)
misc_setup(rps)
take_action(rps)
-   cleanup()
+   cleanup(rps)
if return_val is not None: sys.exit(return_val)
 
 def Backup(rpin, rpout):
@@ -355,6 +361,7 @@
 
 def backup_check_dirs(rpin, rpout):
Make sure in and out dirs exist and are directories
+   global rpin_perms
if rpout.lstat() and not rpout.isdir():
if not force: Log.FatalError(Destination %s exists and is not 
a 
 
directory % rpout.path)
@@ -372,6 +379,15 @@
Log.FatalError(Source directory %s does not exist % rpin.path)
elif not rpin.isdir():
Log.FatalError(Source %s is not a directory % rpin.path)
+
+   if not rpin.hasfullperms() or not rpout.hasfullperms():
+   if rpin.isowner() and rpout.isowner():
+   rpin_perms = rpin.getperms()
+   rpin.chmod(0700)
+   rpout.chmod(0700)
+   else:
+   Log.FatalError(Souce directory %s is unreadable % 
rpin.path)
+
Globals.rbdir = rpout.append_path(rdiff-backup-data)
 
 def backup_set_rbdir(rpin, rpout):
___
rdiff-backup-users mailing list at rdiff-backup-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki