summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-12-22 16:57:41 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-12-22 16:57:41 +0000
commit53b282f4333293ed897f81cddc77c4b5d873a285 (patch)
treedb2bdadefc4e7b46530a8fb44982aa20069306d0 /rdiff-backup/rdiff_backup
parente601a12bfe58ac74f2e510f063e7ee93f5e9359e (diff)
downloadrdiff-backup-53b282f4333293ed897f81cddc77c4b5d873a285.tar.gz
Prevent backing-up reparse points on Windows
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@977 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup')
-rw-r--r--rdiff-backup/rdiff_backup/Main.py3
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py10
2 files changed, 13 insertions, 0 deletions
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py
index e6adec1..2576933 100644
--- a/rdiff-backup/rdiff_backup/Main.py
+++ b/rdiff-backup/rdiff_backup/Main.py
@@ -356,6 +356,9 @@ def backup_quoted_rpaths(rpout):
def backup_set_select(rpin):
"""Create Select objects on source connection"""
+ if rpin.conn.os.name == 'nt':
+ log.Log("Symbolic links excluded by default on Windows", 4)
+ select_opts.append(("--exclude-symbolic-links", None))
rpin.conn.backup.SourceStruct.set_source_select(rpin, select_opts,
*select_files)
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index 3655084..9bcdd2e 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -38,6 +38,10 @@ are dealing with are local or remote.
import os, stat, re, sys, shutil, gzip, socket, time, errno
import Globals, Time, static, log, user_group, C
+try:
+ import win32file, winnt
+except ImportError:
+ pass
class SkipFileException(Exception):
"""Signal that the current file should be skipped but then continue
@@ -328,6 +332,12 @@ def make_file_dict_python(filename):
data['devloc'] = statblock[stat.ST_DEV]
data['nlink'] = statblock[stat.ST_NLINK]
+ if os.name == 'nt':
+ attribs = win32file.GetFileAttributes(filename)
+ if attribs & winnt.FILE_ATTRIBUTE_REPARSE_POINT:
+ data['type'] = 'sym'
+ data['linkname'] = None
+
if not (type == 'sym' or type == 'dev'):
# mtimes on symlinks and dev files don't work consistently
data['mtime'] = long(statblock[stat.ST_MTIME])