[CalendarServer-dev] Re: twisted dav : xattrprops on linux
Guido Guenther
agx at sigxcpu.org
Tue Sep 12 00:11:01 PDT 2006
Hi Wilfredo,
On Mon, Sep 11, 2006 at 03:12:51PM -0700, Wilfredo Sánchez Vega wrote:
> (Let's chat on the mailing list; I don't always respond to direct
> mail, get too much and all that.)
>
> That's a weird rule...
>
> Does it make sense for this to be hidden in the xattr library?
> Perhaps not... I kinda hate to so this on OS X just because Linux is
> weird.
I'm using this in twisted to fix this:
--- twisted/web2/dav/xattrprops.py.orig 2006-09-05 22:09:03.000000000 +0200
+++ twisted/web2/dav/xattrprops.py 2006-09-05 23:12:17.000000000 +0200
@@ -32,6 +32,7 @@
__all__ = ["xattrPropertyStore"]
import urllib
+import sys
import xattr
@@ -58,8 +59,11 @@
#
# Dead properties are stored as extended attributes on disk. In order to
# avoid conflicts with other attributes, prefix dead property names.
- #
- deadPropertyXattrPrefix = "WebDAV:"
+ # Linux additionally needs everything in the user namespace
+ if sys.platform == 'linux2':
+ deadPropertyXattrPrefix = "user.WebDav:"
+ else:
+ deadPropertyXattrPrefix = "WebDAV:"
def _encode(clazz, name):
#
This looks clean and hardcodes the namespace at exactly one place.
Addingt this to xattr doesn't seem reasonable since there are other
namespaces.
Cheers,
-- Guido
More information about the calendarserver-dev
mailing list