rdiff-backup-users
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: symlink fs_abilities (was Re: [rdiff-backup-users] [PATC


From: roland
Subject: Re: [PATCH] Re: symlink fs_abilities (was Re: [rdiff-backup-users] [PATCH]Log symlink creation)
Date: Mon, 20 Nov 2006 19:59:11 +0100

nice patch - and it WORKS!

tested with a loopback mountet vfat filesystem.

I believe this covers the first part - detecting whether the filesystem
supports symlinks. Works for me on Linux/ext3fs and Windows/CIFS
targets. OSError is still thrown when an attempt is made to actually
create a symlink on a filesystem which doesn't support such - to follow.

you mean, it only detects if symlinks are supported by catching the error - but symlinks shouldn`t backup/restore correctly ? that`s not what is see - because i did a small backup/restore test and i was able to restore a backed up symlink from that vfat filesystem.

wondering why symlinks seem to work and this error has been undiscovered for so long

regards
roland


----- Original Message ----- From: "Gordon Rowell" <address@hidden>
Cc: <address@hidden>
Sent: Monday, November 20, 2006 8:13 AM
Subject: [PATCH] Re: symlink fs_abilities (was Re: [rdiff-backup-users] [PATCH]Log symlink creation)


Gordon Rowell wrote:

[...]
So, for cleanliness we should add symlinks as a capability in
fs_abilities so that we don't throw/log the error on filesystems which
do not support symlinks. I'll have a look at that.


I believe this covers the first part - detecting whether the filesystem
supports symlinks. Works for me on Linux/ext3fs and Windows/CIFS
targets. OSError is still thrown when an attempt is made to actually
create a symlink on a filesystem which doesn't support such - to follow.

Thanks,

Gordon




--------------------------------------------------------------------------------


diff -Nur -x '*.orig' -x '*.rej' rdiff-backup-1.1.7/rdiff_backup/fs_abilities.py mezzanine_patched_rdiff-backup-1.1.7/rdiff_backup/fs_abilities.py --- rdiff-backup-1.1.7/rdiff_backup/fs_abilities.py 2006-11-12 20:08:42.000000000 -0700 +++ mezzanine_patched_rdiff-backup-1.1.7/rdiff_backup/fs_abilities.py 2006-11-20 00:01:59.000000000 -0700
@@ -39,6 +39,7 @@
 acls = None # True if access control lists supported
 eas = None # True if extended attributes supported
 hardlinks = None # True if hard linking supported
+ symlinks = None # True if symbolic linking supported
 fsync_dirs = None # True if directories can be fsync'd
 dir_inc_perms = None # True if regular files can have full permissions
 resource_forks = None # True if system supports resource forks
@@ -83,6 +84,7 @@
 if not self.read_only:
 add_boolean_list([('Ownership changing', self.ownership),
   ('Hard linking', self.hardlinks),
+   ('Symbolic linking', self.symlinks),
   ('fsync() directories', self.fsync_dirs),
   ('Directory inc permissions',
    self.dir_inc_perms),
@@ -138,6 +140,7 @@
 self.set_case_sensitive_readwrite(subdir)
 self.set_ownership(subdir)
 self.set_hardlinks(subdir)
+ self.set_symlinks(subdir)
 self.set_fsync_dirs(subdir)
 self.set_eas(subdir, 1)
 self.set_acls(subdir)
@@ -178,6 +181,19 @@
 self.hardlinks = 0
 else: self.hardlinks = 1

+        def set_symlinks(self, testdir):
+ """Set self.symlinks to true iff symbolic links can be made"""
+                sl_target = testdir.append("symlink_target")
+                sl_target.touch();
+                sl_source = testdir.append("symlink_source")
+                try:
+                        sl_source.symlink(sl_target.path)
+                except (IOError, OSError):
+ log.Log("Warning: symbolic links not supported by filesystem " + "at %s" % (self.root_rp.path,), 3)
+                        self.symlinks = 0
+                else: self.symlinks = 1
+
 def set_fsync_dirs(self, testdir):
 """Set self.fsync_dirs if directories can be fsync'd"""
 assert testdir.conn is Globals.local_connection




--------------------------------------------------------------------------------


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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]