From 4af0618d37c526ae1becb3916eab61c70084ee63 Mon Sep 17 00:00:00 2001 From: joshn Date: Thu, 1 Oct 2009 01:09:09 +0000 Subject: Fix exception in win_acls.py when backing up Windows -> Linux. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@1059 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/win_acls.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rdiff-backup/rdiff_backup/win_acls.py b/rdiff-backup/rdiff_backup/win_acls.py index 41a3f6b..f93488a 100644 --- a/rdiff-backup/rdiff_backup/win_acls.py +++ b/rdiff-backup/rdiff_backup/win_acls.py @@ -28,6 +28,8 @@ except ImportError: OWNER_SECURITY_INFORMATION = 0 DACL_SECURITY_INFORMATION = 0 + pywintypes = None + def encode(str_): if type(str_) == unicode: return str_.encode('utf-8') @@ -46,6 +48,12 @@ class ACL: def load_from_rp(self, rp, skip_inherit_only = True): self.index = rp.index + + # Sometimes, we are asked to load from an rpath when ACL's + # are not supported. Ignore the request in this case. + if not pywintypes: + return + try: sd = rp.conn.win32security. \ GetNamedSecurityInfo(rp.path, SE_FILE_OBJECT, ACL.flags) -- cgit v1.2.1