[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Rdiff-backup-commits] rdiff-backup/rdiff_backup win_acls.py
From: |
Josh Nisly |
Subject: |
[Rdiff-backup-commits] rdiff-backup/rdiff_backup win_acls.py |
Date: |
Sat, 16 May 2009 03:00:57 +0000 |
CVSROOT: /sources/rdiff-backup
Module name: rdiff-backup
Changes by: Josh Nisly <joshn> 09/05/16 03:00:57
Modified files:
rdiff_backup : win_acls.py
Log message:
Provide backwards compatibility with non-unicode version of Windows ACL
file.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/rdiff-backup/rdiff_backup/win_acls.py?cvsroot=rdiff-backup&r1=1.5&r2=1.6
Patches:
Index: win_acls.py
===================================================================
RCS file: /sources/rdiff-backup/rdiff-backup/rdiff_backup/win_acls.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- win_acls.py 9 Apr 2009 13:59:19 -0000 1.5
+++ win_acls.py 16 May 2009 03:00:57 -0000 1.6
@@ -28,6 +28,11 @@
OWNER_SECURITY_INFORMATION = 0
DACL_SECURITY_INFORMATION = 0
+def encode(str_):
+ if type(str_) == unicode:
+ return str_.encode('utf-8')
+ return str_
+
class ACL:
flags = (GROUP_SECURITY_INFORMATION|
OWNER_SECURITY_INFORMATION|
@@ -181,7 +186,8 @@
def __str__(self):
return '# file: %s\n%s\n' % \
- (self.get_indexpath(),
unicode(self.__acl))
+
(C.acl_quote(encode(self.get_indexpath())),
+ unicode(self.__acl))
def from_string(self, acl_str):
lines = acl_str.splitlines()
@@ -189,7 +195,7 @@
raise metadata.ParsingError("Bad record beginning: " +
lines[0][:8])
filename = lines[0][8:]
if filename == '.': self.index = ()
- else: self.index = tuple(filename.split('/'))
+ else: self.index =
tuple(unicode(C.acl_unquote(filename)).split('/'))
self.__acl = lines[1]
def Record2WACL(record):
- [Rdiff-backup-commits] rdiff-backup/rdiff_backup win_acls.py,
Josh Nisly <=