[CalendarServer-changes] [155] CalendarServer/branches/users/cdaboo/quota

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 19 12:47:50 PDT 2006


Revision: 155
Author:   cdaboo at apple.com
Date:     2006-09-19 12:47:45 -0700 (Tue, 19 Sep 2006)

Log Message:
-----------
merge -r143:154 https://svn.opensource.apple.com/repository/calendarserver/CalendarServer/trunk .

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/quota/lib-patches/vObject/base.patch
    CalendarServer/branches/users/cdaboo/quota/lib-patches/vObject/icalendar.patch
    CalendarServer/branches/users/cdaboo/quota/run
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/itip.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/copymove.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/mkcalendar.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/post.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_calquery.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_common.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_multiget.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/schedule.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/schedule_common.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/resource.py
    CalendarServer/branches/users/cdaboo/quota/twistedcaldav/static.py

Added Paths:
-----------
    CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.svnversion.patch
    CalendarServer/branches/users/cdaboo/quota/lib-patches/xattr/
    CalendarServer/branches/users/cdaboo/quota/lib-patches/xattr/xattr.FreeBSD.patch

Removed Paths:
-------------
    CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.dav.filter.patch
    CalendarServer/branches/users/cdaboo/quota/lib-patches/xattr/xattr.FreeBSD.patch

Copied: CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.svnversion.patch (from rev 154, CalendarServer/trunk/lib-patches/Twisted/twisted.svnversion.patch)
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.svnversion.patch	                        (rev 0)
+++ CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.svnversion.patch	2006-09-19 19:47:45 UTC (rev 155)
@@ -0,0 +1,24 @@
+Index: twisted/python/versions.py
+===================================================================
+--- twisted/python/versions.py  (revision 18204)
++++ twisted/python/versions.py  (working copy)
+@@ -90,17 +90,8 @@
+         """
+         mod = sys.modules.get(self.package)
+         if mod:
+-            ent = os.path.join(os.path.dirname(mod.__file__),
+-                               '.svn',
+-                               'entries')
+-            if os.path.exists(ent):
+-                from xml.dom.minidom import parse
+-                doc = parse(file(ent)).documentElement
+-                for node in doc.childNodes:
+-                    if hasattr(node, 'getAttribute'):
+-                        rev = node.getAttribute('revision')
+-                        if rev is not None:
+-                            return rev.encode('ascii')
++            rev = os.popen("svnversion %r" % (os.path.dirname(mod.__file__),)).read()
++            return rev
+ 
+     def _formatSVNVersion(self):
+         ver = self._getSVNVersion()

Deleted: CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.dav.filter.patch
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.dav.filter.patch	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/lib-patches/Twisted/twisted.web2.dav.filter.patch	2006-09-19 19:47:45 UTC (rev 155)
@@ -1,82 +0,0 @@
-Index: twisted/web2/dav/filter/__init__.py
-===================================================================
---- twisted/web2/dav/filter/__init__.py	(revision 0)
-+++ twisted/web2/dav/filter/__init__.py	(revision 0)
-@@ -0,0 +1,31 @@
-+##
-+# Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
-+#
-+# Permission is hereby granted, free of charge, to any person obtaining a copy
-+# of this software and associated documentation files (the "Software"), to deal
-+# in the Software without restriction, including without limitation the rights
-+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-+# copies of the Software, and to permit persons to whom the Software is
-+# furnished to do so, subject to the following conditions:
-+# 
-+# The above copyright notice and this permission notice shall be included in all
-+# copies or substantial portions of the Software.
-+# 
-+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-+# SOFTWARE.
-+#
-+# DRI: Cyrus Daboo, cdaboo at apple.com
-+##
-+
-+"""
-+Output filters.
-+"""
-+
-+__all__ = [
-+    "location",
-+]
-Index: twisted/web2/dav/filter/location.py
-===================================================================
---- twisted/web2/dav/filter/location.py	(revision 0)
-+++ twisted/web2/dav/filter/location.py	(revision 0)
-@@ -0,0 +1,41 @@
-+"""
-+Filter that adds a Location header to a response if the status is 201 Created.
-+"""
-+
-+__all__ = ['locationfilter']
-+
-+from twisted.web2 import responsecode
-+import urlparse
-+
-+def addlocation(request, location):
-+    """
-+    Ensure that the supplied location URI is added to any response to this request.
-+
-+    @param request:  L{IRequest} the request whose response is to be modified.
-+    @param location: the C{str} containing the path relative URI for the location header value.
-+    """
-+
-+    def locationfilter(request, response): #@UnusedVariable
-+        """
-+        Add a Location header to the response if the status is 201. Note that the location
-+        value must be a valid URI (already % encoded etc).
-+    
-+        @param request:  L{IRequest} for the current request.
-+        @param response: L{IResponse} for the response to add the header to.
-+        @return: the original L{IResponse} with (or without) the added header.
-+        """
-+        
-+        if (response.code == responsecode.CREATED):
-+            # Check to see whether we have an absolute URI or not. If not, have the request
-+            # turn it into an absolute URI.
-+            (scheme, host, path, params, querystring, fragment) = urlparse.urlparse(location)
-+            if scheme == '':
-+                abslocation = request.unparseURL(path=location)
-+            else:
-+                abslocation = location
-+        
-+            response.headers.setHeader('location', abslocation)
-+        return response
-+
-+    request.addResponseFilter(locationfilter)
-+    return

Modified: CalendarServer/branches/users/cdaboo/quota/lib-patches/vObject/base.patch
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/lib-patches/vObject/base.patch	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/lib-patches/vObject/base.patch	2006-09-19 19:47:45 UTC (rev 155)
@@ -1,6 +1,6 @@
 Index: src/vobject/base.py
 ===================================================================
---- src/vobject/base.py	(revision 147)
+--- src/vobject/base.py	(revision 155)
 +++ src/vobject/base.py	(working copy)
 @@ -1,5 +1,6 @@
  """vobject module for reading vCard and vCalendar files."""

Modified: CalendarServer/branches/users/cdaboo/quota/lib-patches/vObject/icalendar.patch
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/lib-patches/vObject/icalendar.patch	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/lib-patches/vObject/icalendar.patch	2006-09-19 19:47:45 UTC (rev 155)
@@ -1,8 +1,8 @@
 Index: src/vobject/icalendar.py
 ===================================================================
---- src/vobject/icalendar.py	(revision 147)
+--- src/vobject/icalendar.py	(revision 155)
 +++ src/vobject/icalendar.py	(working copy)
-@@ -374,8 +374,17 @@
+@@ -377,8 +377,17 @@
                      try:
                          dtstart = self.dtstart.value
                      except AttributeError, KeyError:
@@ -22,16 +22,7 @@
                      # rrulestr complains about unicode, so cast to str
                      rule = dateutil.rrule.rrulestr(str(line.value),
                                                     dtstart=dtstart)
-@@ -380,7 +389,7 @@
-                     rule = dateutil.rrule.rrulestr(str(line.value),
-                                                    dtstart=dtstart)
-                     until = rule._until 
--                    if until is not None and until.tzinfo != dtstart.tzinfo:
-+                    if until is not None and isinstance(dtstart, datetime.datetime) and (until.tzinfo != dtstart.tzinfo):
-                         # dateutil converts the UNTIL date to a datetime,
-                         # check to see if the UNTIL parameter value was a date
-                         vals = dict(pair.split('=') for pair in
-@@ -417,7 +426,16 @@
+@@ -422,7 +431,16 @@
          return rruleset
  
      def setrruleset(self, rruleset):
@@ -49,7 +40,7 @@
          isDate = datetime.date == type(dtstart)
          if isDate:
              dtstart = datetime.datetime(dtstart.year,dtstart.month, dtstart.day)
-@@ -573,6 +591,8 @@
+@@ -580,6 +598,8 @@
          if obj.value.tzinfo is None:
              obj.params['X-VOBJ-FLOATINGTIME-ALLOWED'] = ['TRUE']
          if obj.params.get('TZID'):
@@ -58,7 +49,7 @@
              del obj.params['TZID']
          return obj
  
-@@ -585,6 +605,10 @@
+@@ -592,6 +612,10 @@
              obj.value = dateTimeToString(obj.value, cls.forceUTC)
              if not cls.forceUTC and tzid is not None:
                  obj.tzid_param = tzid
@@ -69,7 +60,7 @@
  
          return obj
  
-@@ -605,7 +629,10 @@
+@@ -612,7 +636,10 @@
          obj.value=str(obj.value)
          obj.value=parseDtstart(obj)
          if getattr(obj, 'value_param', 'DATE-TIME').upper() == 'DATE-TIME':

Copied: CalendarServer/branches/users/cdaboo/quota/lib-patches/xattr (from rev 154, CalendarServer/trunk/lib-patches/xattr)

Deleted: CalendarServer/branches/users/cdaboo/quota/lib-patches/xattr/xattr.FreeBSD.patch
===================================================================
--- CalendarServer/trunk/lib-patches/xattr/xattr.FreeBSD.patch	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/lib-patches/xattr/xattr.FreeBSD.patch	2006-09-19 19:47:45 UTC (rev 155)
@@ -1,238 +0,0 @@
-Index: Modules/xattr/_xattr.c
-===================================================================
---- Modules/xattr/_xattr.c	(revision 545)
-+++ Modules/xattr/_xattr.c	(working copy)
-@@ -1,6 +1,232 @@
- #include "Python.h"
-+#ifdef __FreeBSD__
-+#include <sys/extattr.h>
-+#else
- #include <sys/xattr.h>
--#ifndef XATTR_NOFOLLOW
-+#endif
-+
-+#ifdef __FreeBSD__
-+
-+/* FreeBSD compatibility API */
-+#define XATTR_XATTR_NOFOLLOW 0x0001
-+#define XATTR_XATTR_CREATE 0x0002
-+#define XATTR_XATTR_REPLACE 0x0004
-+#define XATTR_XATTR_NOSECURITY 0x0008
-+
-+
-+/* Converts a freebsd format attribute list into a NULL terminated list.
-+ * While the man page on extattr_list_file says it is NULL terminated, 
-+ * it is actually the first byte that is the length of the
-+ * following attribute.
-+ */
-+static void convert_bsd_list(char *namebuf, size_t size)
-+{
-+    size_t offset = 0;
-+    while(offset < size) {
-+        int length = (int) namebuf[offset];
-+        memmove(namebuf+offset, namebuf+offset+1, length);
-+        namebuf[offset+length] = '\0';
-+        offset += length+1;
-+    }
-+}
-+
-+static ssize_t xattr_getxattr(const char *path, const char *name,
-+                              void *value, ssize_t size, u_int32_t position, 
-+                              int options)
-+{
-+    if (position != 0 || 
-+        !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-+        return -1;
-+    }
-+
-+    if (options & XATTR_XATTR_NOFOLLOW) {
-+        return extattr_get_link(path, EXTATTR_NAMESPACE_USER,
-+                                name, value, size);
-+    }
-+    else {
-+        return extattr_get_file(path, EXTATTR_NAMESPACE_USER,
-+                                name, value, size);
-+    }
-+}
-+
-+static ssize_t xattr_setxattr(const char *path, const char *name,
-+                              void *value, ssize_t size, u_int32_t position,
-+                              int options)
-+{
-+    int rv = 0;
-+    int nofollow;
-+
-+    if (position != 0) {
-+        return -1;
-+    }
-+
-+    nofollow = options & XATTR_XATTR_NOFOLLOW;
-+    options &= ~XATTR_XATTR_NOFOLLOW;
-+
-+    if (options == XATTR_XATTR_CREATE ||
-+        options == XATTR_XATTR_REPLACE) {
-+
-+        /* meh. FreeBSD doesn't really have this in it's
-+         * API... Oh well. 
-+         */
-+    }
-+    else if (options != 0) {
-+        return -1;
-+    }
-+
-+    if (options & XATTR_XATTR_NOFOLLOW) {
-+        rv = extattr_set_link(path, EXTATTR_NAMESPACE_USER,
-+                                name, value, size);
-+    }
-+    else {
-+        rv = extattr_set_file(path, EXTATTR_NAMESPACE_USER,
-+                                name, value, size);
-+    }
-+
-+    /* freebsd returns the written length on success, not zero. */
-+    if (rv >= 0) {
-+        return 0;
-+    }
-+    else {
-+        return rv;
-+    }
-+}
-+
-+static ssize_t xattr_removexattr(const char *path, const char *name,
-+                                 int options)
-+{
-+    if (!(options == 0 ||
-+          options == XATTR_XATTR_NOFOLLOW)) {
-+        return -1;
-+    }
-+
-+    if (options & XATTR_XATTR_NOFOLLOW) {
-+        return extattr_delete_link(path, EXTATTR_NAMESPACE_USER, name);
-+    }
-+    else {
-+        return extattr_delete_file(path, EXTATTR_NAMESPACE_USER, name);
-+    }
-+}
-+
-+
-+static ssize_t xattr_listxattr(const char *path, char *namebuf,
-+                               size_t size, int options)
-+{
-+    ssize_t rv = 0;
-+    if (!(options == 0 ||
-+          options == XATTR_XATTR_NOFOLLOW)) {
-+        return -1;
-+    }
-+
-+    if (options & XATTR_XATTR_NOFOLLOW) {
-+        rv = extattr_list_link(path, EXTATTR_NAMESPACE_USER, namebuf, size);
-+    }
-+    else {
-+        rv = extattr_list_file(path, EXTATTR_NAMESPACE_USER, namebuf, size);
-+    }
-+
-+    if (rv > 0 && namebuf) {
-+        convert_bsd_list(namebuf, rv);
-+    }
-+
-+    return rv;
-+}
-+
-+static ssize_t xattr_fgetxattr(int fd, const char *name, void *value,
-+                               ssize_t size, u_int32_t position, int options)
-+{
-+    if (position != 0 ||
-+        !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-+        return -1;
-+    }
-+
-+    if (options & XATTR_XATTR_NOFOLLOW) {
-+        return -1;
-+    }
-+    else {
-+        return extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size);
-+    }
-+}
-+
-+static ssize_t xattr_fsetxattr(int fd, const char *name, void *value,
-+                               ssize_t size, u_int32_t position, int options)
-+{
-+    int rv = 0;
-+    int nofollow;
-+
-+    if (position != 0) {
-+        return -1;
-+    }
-+
-+    nofollow = options & XATTR_XATTR_NOFOLLOW;
-+    options &= ~XATTR_XATTR_NOFOLLOW;
-+
-+    if (options == XATTR_XATTR_CREATE ||
-+        options == XATTR_XATTR_REPLACE) {
-+        /* freebsd noop */
-+    }
-+    else if (options != 0) {
-+        return -1;
-+    }
-+
-+    if (options & XATTR_XATTR_NOFOLLOW) {
-+        return -1;
-+    }
-+    else {
-+        rv = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, 
-+                            name, value, size);
-+    }
-+
-+    /* freebsd returns the written length on success, not zero. */
-+    if (rv >= 0) {
-+        return 0;
-+    }
-+    else {
-+        return rv;
-+    }
-+}
-+
-+static ssize_t xattr_fremovexattr(int fd, const char *name, int options)
-+{
-+
-+    if (!(options == 0 ||
-+          options == XATTR_XATTR_NOFOLLOW)) {
-+        return -1;
-+    }
-+
-+    if (options & XATTR_XATTR_NOFOLLOW) {
-+        return -1;
-+    }
-+    else {
-+        return extattr_delete_fd(fd, EXTATTR_NAMESPACE_USER, name);
-+    }
-+}
-+
-+
-+static ssize_t xattr_flistxattr(int fd, char *namebuf, size_t size, int options)
-+{
-+    ssize_t rv = 0;
-+
-+    if (!(options == 0 ||
-+          options == XATTR_XATTR_NOFOLLOW)) {
-+        return -1;
-+    }
-+
-+    if (options & XATTR_XATTR_NOFOLLOW) {
-+        return -1;
-+    }
-+    else {
-+        rv = extattr_list_fd(fd, EXTATTR_NAMESPACE_USER, namebuf, size);
-+    }
-+
-+    if (rv > 0 && namebuf) {
-+        convert_bsd_list(namebuf, rv);
-+    }
-+
-+    return rv;
-+}
-+
-+#elif !defined(XATTR_NOFOLLOW)
- /* Linux compatibility API */
- #define XATTR_XATTR_NOFOLLOW 0x0001
- #define XATTR_XATTR_CREATE 0x0002

Copied: CalendarServer/branches/users/cdaboo/quota/lib-patches/xattr/xattr.FreeBSD.patch (from rev 154, CalendarServer/trunk/lib-patches/xattr/xattr.FreeBSD.patch)
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/lib-patches/xattr/xattr.FreeBSD.patch	                        (rev 0)
+++ CalendarServer/branches/users/cdaboo/quota/lib-patches/xattr/xattr.FreeBSD.patch	2006-09-19 19:47:45 UTC (rev 155)
@@ -0,0 +1,238 @@
+Index: Modules/xattr/_xattr.c
+===================================================================
+--- Modules/xattr/_xattr.c	(revision 545)
++++ Modules/xattr/_xattr.c	(working copy)
+@@ -1,6 +1,232 @@
+ #include "Python.h"
++#ifdef __FreeBSD__
++#include <sys/extattr.h>
++#else
+ #include <sys/xattr.h>
+-#ifndef XATTR_NOFOLLOW
++#endif
++
++#ifdef __FreeBSD__
++
++/* FreeBSD compatibility API */
++#define XATTR_XATTR_NOFOLLOW 0x0001
++#define XATTR_XATTR_CREATE 0x0002
++#define XATTR_XATTR_REPLACE 0x0004
++#define XATTR_XATTR_NOSECURITY 0x0008
++
++
++/* Converts a freebsd format attribute list into a NULL terminated list.
++ * While the man page on extattr_list_file says it is NULL terminated, 
++ * it is actually the first byte that is the length of the
++ * following attribute.
++ */
++static void convert_bsd_list(char *namebuf, size_t size)
++{
++    size_t offset = 0;
++    while(offset < size) {
++        int length = (int) namebuf[offset];
++        memmove(namebuf+offset, namebuf+offset+1, length);
++        namebuf[offset+length] = '\0';
++        offset += length+1;
++    }
++}
++
++static ssize_t xattr_getxattr(const char *path, const char *name,
++                              void *value, ssize_t size, u_int32_t position, 
++                              int options)
++{
++    if (position != 0 || 
++        !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
++        return -1;
++    }
++
++    if (options & XATTR_XATTR_NOFOLLOW) {
++        return extattr_get_link(path, EXTATTR_NAMESPACE_USER,
++                                name, value, size);
++    }
++    else {
++        return extattr_get_file(path, EXTATTR_NAMESPACE_USER,
++                                name, value, size);
++    }
++}
++
++static ssize_t xattr_setxattr(const char *path, const char *name,
++                              void *value, ssize_t size, u_int32_t position,
++                              int options)
++{
++    int rv = 0;
++    int nofollow;
++
++    if (position != 0) {
++        return -1;
++    }
++
++    nofollow = options & XATTR_XATTR_NOFOLLOW;
++    options &= ~XATTR_XATTR_NOFOLLOW;
++
++    if (options == XATTR_XATTR_CREATE ||
++        options == XATTR_XATTR_REPLACE) {
++
++        /* meh. FreeBSD doesn't really have this in it's
++         * API... Oh well. 
++         */
++    }
++    else if (options != 0) {
++        return -1;
++    }
++
++    if (options & XATTR_XATTR_NOFOLLOW) {
++        rv = extattr_set_link(path, EXTATTR_NAMESPACE_USER,
++                                name, value, size);
++    }
++    else {
++        rv = extattr_set_file(path, EXTATTR_NAMESPACE_USER,
++                                name, value, size);
++    }
++
++    /* freebsd returns the written length on success, not zero. */
++    if (rv >= 0) {
++        return 0;
++    }
++    else {
++        return rv;
++    }
++}
++
++static ssize_t xattr_removexattr(const char *path, const char *name,
++                                 int options)
++{
++    if (!(options == 0 ||
++          options == XATTR_XATTR_NOFOLLOW)) {
++        return -1;
++    }
++
++    if (options & XATTR_XATTR_NOFOLLOW) {
++        return extattr_delete_link(path, EXTATTR_NAMESPACE_USER, name);
++    }
++    else {
++        return extattr_delete_file(path, EXTATTR_NAMESPACE_USER, name);
++    }
++}
++
++
++static ssize_t xattr_listxattr(const char *path, char *namebuf,
++                               size_t size, int options)
++{
++    ssize_t rv = 0;
++    if (!(options == 0 ||
++          options == XATTR_XATTR_NOFOLLOW)) {
++        return -1;
++    }
++
++    if (options & XATTR_XATTR_NOFOLLOW) {
++        rv = extattr_list_link(path, EXTATTR_NAMESPACE_USER, namebuf, size);
++    }
++    else {
++        rv = extattr_list_file(path, EXTATTR_NAMESPACE_USER, namebuf, size);
++    }
++
++    if (rv > 0 && namebuf) {
++        convert_bsd_list(namebuf, rv);
++    }
++
++    return rv;
++}
++
++static ssize_t xattr_fgetxattr(int fd, const char *name, void *value,
++                               ssize_t size, u_int32_t position, int options)
++{
++    if (position != 0 ||
++        !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
++        return -1;
++    }
++
++    if (options & XATTR_XATTR_NOFOLLOW) {
++        return -1;
++    }
++    else {
++        return extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size);
++    }
++}
++
++static ssize_t xattr_fsetxattr(int fd, const char *name, void *value,
++                               ssize_t size, u_int32_t position, int options)
++{
++    int rv = 0;
++    int nofollow;
++
++    if (position != 0) {
++        return -1;
++    }
++
++    nofollow = options & XATTR_XATTR_NOFOLLOW;
++    options &= ~XATTR_XATTR_NOFOLLOW;
++
++    if (options == XATTR_XATTR_CREATE ||
++        options == XATTR_XATTR_REPLACE) {
++        /* freebsd noop */
++    }
++    else if (options != 0) {
++        return -1;
++    }
++
++    if (options & XATTR_XATTR_NOFOLLOW) {
++        return -1;
++    }
++    else {
++        rv = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, 
++                            name, value, size);
++    }
++
++    /* freebsd returns the written length on success, not zero. */
++    if (rv >= 0) {
++        return 0;
++    }
++    else {
++        return rv;
++    }
++}
++
++static ssize_t xattr_fremovexattr(int fd, const char *name, int options)
++{
++
++    if (!(options == 0 ||
++          options == XATTR_XATTR_NOFOLLOW)) {
++        return -1;
++    }
++
++    if (options & XATTR_XATTR_NOFOLLOW) {
++        return -1;
++    }
++    else {
++        return extattr_delete_fd(fd, EXTATTR_NAMESPACE_USER, name);
++    }
++}
++
++
++static ssize_t xattr_flistxattr(int fd, char *namebuf, size_t size, int options)
++{
++    ssize_t rv = 0;
++
++    if (!(options == 0 ||
++          options == XATTR_XATTR_NOFOLLOW)) {
++        return -1;
++    }
++
++    if (options & XATTR_XATTR_NOFOLLOW) {
++        return -1;
++    }
++    else {
++        rv = extattr_list_fd(fd, EXTATTR_NAMESPACE_USER, namebuf, size);
++    }
++
++    if (rv > 0 && namebuf) {
++        convert_bsd_list(namebuf, rv);
++    }
++
++    return rv;
++}
++
++#elif !defined(XATTR_NOFOLLOW)
+ /* Linux compatibility API */
+ #define XATTR_XATTR_NOFOLLOW 0x0001
+ #define XATTR_XATTR_CREATE 0x0002

Modified: CalendarServer/branches/users/cdaboo/quota/run
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/run	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/run	2006-09-19 19:47:45 UTC (rev 155)
@@ -406,13 +406,16 @@
 #
 
 if ! "${disable_setup}"; then
-  if [ "${USER}" == "wsanchez" ]; then
-    svn_uri="svn+ssh://svn.twistedmatrix.com/svn/Twisted/branches/acl-1608-8";
-  else
-    svn_uri="svn://svn.twistedmatrix.com/svn/Twisted/branches/acl-1608-8";
-  fi;
-
-  svn_get "Twisted" "${twisted}" "${svn_uri}" 18165;
+  case "${USER}" in
+    wsanchez)
+      proto="svn+ssh";
+      ;;
+    *)
+      proto="svn";
+      ;;
+  esac;
+  svn_uri="${proto}://svn.twistedmatrix.com/svn/Twisted/branches/dav-acl-1608";
+  svn_get "Twisted" "${twisted}" "${svn_uri}" 18205;
 fi;
 py_install "Twisted" "${twisted}";
  
@@ -448,12 +451,16 @@
 vobject="${top}/vobject";
 
 if ! "${disable_setup}"; then
-  if [ "${USER}" == "cyrusdaboo" ]; then
-    svn_uri="svn+ssh://cdaboo@svn.osafoundation.org/svn/vobject/trunk";
-  else
-    svn_uri="http://svn.osafoundation.org/vobject/trunk";
-  fi;
-  svn_get "vObject" "${vobject}" "${svn_uri}" 147;
+  case "${USER}" in
+    cyrusdaboo)
+      base="svn+ssh://cdaboo@svn.osafoundation.org/svn";
+      ;;
+    *)
+      base="http://svn.osafoundation.org";
+      ;;
+  esac;
+  svn_uri="${base}/vobject/trunk";
+  svn_get "vObject" "${vobject}" "${svn_uri}" 155;
 fi;
 py_install "vObject" "${vobject}";
 

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/itip.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/itip.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/itip.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -565,7 +565,7 @@
     inbox = inbox.getResult()
 
     try:
-        d = waitForDeferred(inbox.checkAccess(request, (caldavxml.Schedule(),), principal=davxml.Principal(davxml.HRef.fromString(principal.principalURL()))))
+        d = waitForDeferred(inbox.checkPrivileges(request, (caldavxml.Schedule(),), principal=davxml.Principal(davxml.HRef.fromString(principal.principalURL()))))
         yield d
         d.getResult()
     except:
@@ -600,7 +600,7 @@
     outbox = outbox.getResult()
 
     try:
-        d = waitForDeferred(outbox.checkAccess(request, (caldavxml.Schedule(),), principal=davxml.Principal(davxml.HRef.fromString(principal.principalURL()))))
+        d = waitForDeferred(outbox.checkPrivileges(request, (caldavxml.Schedule(),), principal=davxml.Principal(davxml.HRef.fromString(principal.principalURL()))))
         yield d
         d.getResult()
     except:

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/copymove.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/copymove.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/copymove.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -27,8 +27,8 @@
 from twisted.internet.defer import deferredGenerator, waitForDeferred
 from twisted.python import log
 from twisted.web2 import responsecode
+from twisted.web2.filter.location import addLocation
 from twisted.web2.dav import davxml
-from twisted.web2.dav.filter.location import addlocation
 from twisted.web2.dav.http import ErrorResponse
 from twisted.web2.dav.util import parentForURL
 from twisted.web2.http import StatusResponse, HTTPError
@@ -58,12 +58,12 @@
     #
     # Check authentication and access controls
     #
-    x = waitForDeferred(self.securityCheck(request, (davxml.Read(),), recurse=True))
+    x = waitForDeferred(self.authorize(request, (davxml.Read(),), recurse=True))
     yield x
     x.getResult()
 
     if destination.exists():
-        x = waitForDeferred(destination.securityCheck(request, (davxml.WriteContent(), davxml.WriteProperties()), recurse=True))
+        x = waitForDeferred(destination.authorize(request, (davxml.WriteContent(), davxml.WriteProperties()), recurse=True))
         yield x
         x.getResult()
     else:
@@ -71,7 +71,7 @@
         yield destparent
         destparent = destparent.getResult()
  
-        x = waitForDeferred(destparent.securityCheck(request, (davxml.Bind(),)))
+        x = waitForDeferred(destparent.authorize(request, (davxml.Bind(),)))
         yield x
         x.getResult()
 
@@ -99,7 +99,7 @@
         )
 
     # May need to add a location header
-    addlocation(request, destination_uri)
+    addLocation(request, destination_uri)
 
     x = waitForDeferred(storeCalendarObjectResource(
         request = request,
@@ -141,12 +141,12 @@
     yield parent
     parent = parent.getResult()
 
-    x = waitForDeferred(parent.securityCheck(request, (davxml.Unbind(),)))
+    x = waitForDeferred(parent.authorize(request, (davxml.Unbind(),)))
     yield x
     x.getResult()
 
     if destination.exists():
-        x = waitForDeferred(destination.securityCheck(request, (davxml.Bind(), davxml.Unbind()), recurse=True))
+        x = waitForDeferred(destination.authorize(request, (davxml.Bind(), davxml.Unbind()), recurse=True))
         yield x
         x.getResult()
     else:
@@ -154,7 +154,7 @@
         yield destparent
         destparent = destparent.getResult()
 
-        x = waitForDeferred(destparent.securityCheck(request, (davxml.Bind(),)))
+        x = waitForDeferred(destparent.authorize(request, (davxml.Bind(),)))
         yield x
         x.getResult()
 
@@ -183,7 +183,7 @@
             ))
 
     # May need to add a location header
-    addlocation(request, destination_uri)
+    addLocation(request, destination_uri)
 
     x = waitForDeferred(storeCalendarObjectResource(
         request = request,

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/mkcalendar.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/mkcalendar.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/mkcalendar.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -50,7 +50,7 @@
     yield parent
     parent = parent.getResult()
 
-    x = waitForDeferred(parent.securityCheck(request, (davxml.Bind(),)))
+    x = waitForDeferred(parent.authorize(request, (davxml.Bind(),)))
     yield x
     x.getResult()
 

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/post.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/post.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/post.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -48,7 +48,7 @@
     yield parent
     parent = parent.getResult()
 
-    d = waitForDeferred(parent.securityCheck(request, (caldavxml.Schedule(),)))
+    d = waitForDeferred(parent.authorize(request, (caldavxml.Schedule(),)))
     yield d
     d.getResult()
         

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_calquery.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_calquery.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_calquery.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -141,7 +141,7 @@
                 filter.settimezone(tz)
 
             # Do some optimisation of access control calculation by determining any inherited ACLs outside of
-            # the child resource loop and supply those to the checkAccess on each child.
+            # the child resource loop and supply those to the checkPrivileges on each child.
             filteredaces = waitForDeferred(calresource.inheritedACEsforChildren(request))
             yield filteredaces
             filteredaces = filteredaces.getResult()
@@ -156,7 +156,7 @@
                     child = child.getResult()
 
                     try:
-                        d = waitForDeferred(child.checkAccess(request, (davxml.Read(),), inheritedaces=filteredaces))
+                        d = waitForDeferred(child.checkPrivileges(request, (davxml.Read(),), inherited_aces=filteredaces))
                         yield d
                         d.getResult()
                     except:

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_common.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_common.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_common.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -70,7 +70,7 @@
 
     # First check the privilege on this resource
     try:
-        d = waitForDeferred(resource.checkAccess(request, privileges))
+        d = waitForDeferred(resource.checkPrivileges(request, privileges))
         yield d
         d.getResult()
     except:
@@ -277,7 +277,7 @@
     
     # First check the privilege on this collection
     try:
-        d = waitForDeferred(calresource.checkAccess(request, (caldavxml.ReadFreeBusy(),)))
+        d = waitForDeferred(calresource.checkPrivileges(request, (caldavxml.ReadFreeBusy(),)))
         yield d
         d.getResult()
     except:
@@ -319,7 +319,7 @@
     tzinfo = filter.settimezone(tz)
 
     # Do some optimisation of access control calculation by determining any inherited ACLs outside of
-    # the child resource loop and supply those to the checkAccess on each child.
+    # the child resource loop and supply those to the checkPrivileges on each child.
     filteredaces = waitForDeferred(calresource.inheritedACEsforChildren(request))
     yield filteredaces
     filteredaces = filteredaces.getResult()
@@ -338,7 +338,7 @@
         child = child.getResult()
 
         try:
-            d = waitForDeferred(child.checkAccess(request, (caldavxml.ReadFreeBusy(),), inheritedaces=filteredaces))
+            d = waitForDeferred(child.checkPrivileges(request, (caldavxml.ReadFreeBusy(),), inherited_aces=filteredaces))
             yield d
             d.getResult()
         except:

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_multiget.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_multiget.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/report_multiget.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -102,7 +102,7 @@
         requestURIis = "calendar"
 
         # Do some optimisation of access control calculation by determining any inherited ACLs outside of
-        # the child resource loop and supply those to the checkAccess on each child.
+        # the child resource loop and supply those to the checkPrivileges on each child.
         filteredaces = waitForDeferred(self.inheritedACEsforChildren(request))
         yield filteredaces
         filteredaces = filteredaces.getResult()
@@ -164,19 +164,19 @@
                 
                 # Check privileges on parent - must have at least DAV:read
                 try:
-                    d = waitForDeferred(parent.checkAccess(request, (davxml.Read(),)))
+                    d = waitForDeferred(parent.checkPrivileges(request, (davxml.Read(),)))
                     yield d
                     d.getResult()
                 except:
                     responses.append(davxml.StatusResponse(href, davxml.Status.fromResponseCode(responsecode.NOT_ALLOWED)))
                     continue
                 
-                # Cache the last parent's inherited aces for checkAccess optimization
+                # Cache the last parent's inherited aces for checkPrivileges optimization
                 if lastParent != parent:
                     lastParent = parent
             
                     # Do some optimisation of access control calculation by determining any inherited ACLs outside of
-                    # the child resource loop and supply those to the checkAccess on each child.
+                    # the child resource loop and supply those to the checkPrivileges on each child.
                     filteredaces = waitForDeferred(parent.inheritedACEsforChildren(request))
                     yield filteredaces
                     filteredaces = filteredaces.getResult()
@@ -198,14 +198,14 @@
                 child = self
         
                 # Do some optimisation of access control calculation by determining any inherited ACLs outside of
-                # the child resource loop and supply those to the checkAccess on each child.
+                # the child resource loop and supply those to the checkPrivileges on each child.
                 filteredaces = waitForDeferred(parent.inheritedACEsforChildren(request))
                 yield filteredaces
                 filteredaces = filteredaces.getResult()
     
             # Check privileges - must have at least DAV:read
             try:
-                d = waitForDeferred(child.checkAccess(request, (davxml.Read(),), inheritedaces=filteredaces))
+                d = waitForDeferred(child.checkPrivileges(request, (davxml.Read(),), inherited_aces=filteredaces))
                 yield d
                 d.getResult()
             except:

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/schedule.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/schedule.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/schedule.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -48,7 +48,7 @@
     yield parent
     parent = parent.getResult()
 
-    d = waitForDeferred(parent.securityCheck(request, (caldavxml.Schedule(),)))
+    d = waitForDeferred(parent.authorize(request, (caldavxml.Schedule(),)))
     yield d
     d.getResult()
         

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/schedule_common.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/schedule_common.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/method/schedule_common.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -259,7 +259,7 @@
             # Check access controls
             #
             try:
-                d = waitForDeferred(inbox.checkAccess(request, (caldavxml.Schedule(),), principal=davxml.Principal(davxml.HRef.fromString(oprincipal))))
+                d = waitForDeferred(inbox.checkPrivileges(request, (caldavxml.Schedule(),), principal=davxml.Principal(davxml.HRef.fromString(oprincipal))))
                 yield d
                 d.getResult()
             except:

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/resource.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/resource.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/resource.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -229,31 +229,31 @@
         """
         assert depth in ("0", "1", "infinity"), "Invalid depth: %s" % (depth,)
 
-        def _checkAccessEb(failure):
+        def checkPrivilegesError(failure):
             failure.trap(AccessDeniedError)
             
-            reactor.callLater(0, _getChild)
+            reactor.callLater(0, getChild)
 
-        def _checkAccess(child):
+        def checkPrivileges(child):
             if privileges is None:
                 return child
    
-            ca = child.checkAccess(request, privileges)
+            ca = child.checkPrivileges(request, privileges)
             ca.addCallback(lambda ign: child)
             return ca
 
-        def _gotChild(child, childpath):
+        def gotChild(child, childpath):
             if child.isCalendarCollection():
                 callback(child, childpath)
             elif child.isCollection():
                 if depth == 'infinity': 
                     fc = child.findCalendarCollections(depth, request, callback, privileges)
-                    fc.addCallback(lambda x: reactor.callLater(0, _getChild))
+                    fc.addCallback(lambda x: reactor.callLater(0, getChild))
                     return fc
 
-            reactor.callLater(0, _getChild)
+            reactor.callLater(0, getChild)
 
-        def _getChild():
+        def getChild():
             try:
                 childname = children.pop()
             except IndexError:
@@ -261,8 +261,8 @@
             else:
                 childpath = joinURL(basepath, childname)
                 child = request.locateResource(childpath)
-                child.addCallback(_checkAccess)
-                child.addCallbacks(_gotChild, _checkAccessEb, (childpath,))
+                child.addCallback(checkPrivileges)
+                child.addCallbacks(gotChild, checkPrivilegesError, (childpath,))
                 child.addErrback(completionDeferred.errback)
 
         completionDeferred = Deferred()
@@ -270,7 +270,7 @@
         if depth != "0" and self.isCollection():
             basepath = request.urlForResource(self)
             children = self.listChildren()
-            _getChild()
+            getChild()
         else:
             completionDeferred.callback(None)
 

Modified: CalendarServer/branches/users/cdaboo/quota/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/users/cdaboo/quota/twistedcaldav/static.py	2006-09-19 19:12:25 UTC (rev 154)
+++ CalendarServer/branches/users/cdaboo/quota/twistedcaldav/static.py	2006-09-19 19:47:45 UTC (rev 155)
@@ -145,7 +145,7 @@
             calendar.addProperty(iProperty("VERSION", "2.0"))
 
             # Do some optimisation of access control calculation by determining any inherited ACLs outside of
-            # the child resource loop and supply those to the checkAccess on each child.
+            # the child resource loop and supply those to the checkPrivileges on each child.
             filteredaces = waitForDeferred(self.inheritedACEsforChildren(request))
             yield filteredaces
             filteredaces = filteredaces.getResult()
@@ -164,7 +164,7 @@
                 if child is not None:
                     # Check privileges of child - skip if access denied
                     try:
-                        d = waitForDeferred(child.checkAccess(request, (davxml.Read(),), inheritedaces=filteredaces))
+                        d = waitForDeferred(child.checkPrivileges(request, (davxml.Read(),), inherited_aces=filteredaces))
                         yield d
                         d.getResult()
                     except:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20060919/c449531b/attachment.html


More information about the calendarserver-changes mailing list