SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Bug (and Fix) with NFS and --exclude-if-present
Author Message
Post Bug (and Fix) with NFS and --exclude-if-present 
Hello Guys.

I recently stumbled upon an error with NFS and --exclude-if-present.

If the NFS-export contains a directory "lost+found", which is owned by
root and has access rights rwx------ (0700) on the nfs-server, then no
process on the client can access that directory (by default, as root
is mapped to nobody).

The selection function (Select.presence_get_sf in selection.py) that
tests for the presence of a file however uses rp.readable() - which
returns true, as the backup-process is root, and the directory is
readable by root, according to its own metadata.

The following lstat-call then throws an OSError-Exception (permission
denied)...

Below is a patch that should solve this problem. I would love to see
this fix (or something comparable) included in the next stable
rdiff-backup-version.

If you have any more questions, please ask.

Greetings,
Jakob Krainz

diff -r eb3cfb65bcb5 selection.py
--- a/selection.py Wed Oct 27 17:21:01 2010 +0200
+++ b/selection.py Wed Oct 27 17:23:19 2010 +0200
< at > < at > -478,9 +478,12 < at > < at >
assert include == 0 or include == 1

def sel_func(rp):
- if rp.isdir() and rp.readable() and \
- rp.append(presence_filename).lstat():
- return include
+ try:
+ if rp.isdir() and rp.readable() and \
+ rp.append(presence_filename).lstat():
+ return include
+ except OSError:
+ return None
return None

sel_func.exclude = not include


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

Post Bug (and Fix) with NFS and --exclude-if-present 
Jakob Krainz wrote: Hello Guys.

I recently stumbled upon an error with NFS and --exclude-if-present.

If the NFS-export contains a directory "lost+found", which is owned by
root and has access rights rwx------ (0700) on the nfs-server, then no
process on the client can access that directory (by default, as root
is mapped to nobody).

The selection function (Select.presence_get_sf in selection.py) that
tests for the presence of a file however uses rp.readable() - which
returns true, as the backup-process is root, and the directory is
readable by root, according to its own metadata.

The following lstat-call then throws an OSError-Exception (permission
denied)...

Below is a patch that should solve this problem. I would love to see
this fix (or something comparable) included in the next stable
rdiff-backup-version.

If you have any more questions, please ask.

Greetings,
Jakob Krainz

diff -r eb3cfb65bcb5 selection.py
--- a/selection.py Wed Oct 27 17:21:01 2010 +0200
+++ b/selection.py Wed Oct 27 17:23:19 2010 +0200
< at > < at > -478,9 +478,12 < at > < at >
assert include == 0 or include == 1

def sel_func(rp):
- if rp.isdir() and rp.readable() and
- rp.append(presence_filename).lstat():
- return include
+ try:
+ if rp.isdir() and rp.readable() and
+ rp.append(presence_filename).lstat():
+ return include
+ except OSError:
+ return None
return None

sel_func.exclude = not include


_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users < at > nongnu.org ([email]rdiff-backup-users < at > nongnu.org[/email])
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Hi Jakob,

I don't think there is much active development going on (I'm not a dev here just a user).
Rdiff-backup is pretty stable and works well in a large set of conditions.
But having the patch out there might help someone so thanks for posting it.

Cheers
Gavin
--
www.gnumims.org
www.kromhouts.net
Everything in moderation, including moderation itself.

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB