[CalendarServer-changes] [7762] CalendarServer/branches/users/glyph/xattrs-from-files/txdav/base/ propertystore/appledouble_xattr.py
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jul 11 15:02:17 PDT 2011
Revision: 7762
http://trac.macosforge.org/projects/calendarserver/changeset/7762
Author: glyph at apple.com
Date: 2011-07-11 15:02:17 -0700 (Mon, 11 Jul 2011)
Log Message:
-----------
struct attr_entry.namelen includes NULL terminator, account for that when unpacking
Modified Paths:
--------------
CalendarServer/branches/users/glyph/xattrs-from-files/txdav/base/propertystore/appledouble_xattr.py
Modified: CalendarServer/branches/users/glyph/xattrs-from-files/txdav/base/propertystore/appledouble_xattr.py
===================================================================
--- CalendarServer/branches/users/glyph/xattrs-from-files/txdav/base/propertystore/appledouble_xattr.py 2011-07-11 22:02:05 UTC (rev 7761)
+++ CalendarServer/branches/users/glyph/xattrs-from-files/txdav/base/propertystore/appledouble_xattr.py 2011-07-11 22:02:17 UTC (rev 7762)
@@ -133,8 +133,11 @@
xattr_flags, xattr_name_len] = struct.unpack(
XATTR_ENTRY, data[:XATTR_ENTRY_LENGTH]
)
- xattr_name = data[XATTR_ENTRY_LENGTH:
- XATTR_ENTRY_LENGTH+xattr_name_len]
+ xattr_name = data[
+ XATTR_ENTRY_LENGTH:
+ XATTR_ENTRY_LENGTH + xattr_name_len
+ -1 # strip NULL terminator
+ ]
fileobj.seek(xattr_offset)
xattr_value = fileobj.read(xattr_length)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110711/6626ded4/attachment.html>
More information about the calendarserver-changes
mailing list