[CalendarServer-changes] [15463] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Feb 15 08:03:00 PST 2016


Revision: 15463
          http://trac.calendarserver.org//changeset/15463
Author:   cdaboo at apple.com
Date:     2016-02-15 08:03:00 -0800 (Mon, 15 Feb 2016)
Log Message:
-----------
Fix for invalid vcards during simple/crud bulk create requests.

Modified Paths:
--------------
    CalendarServer/trunk/requirements-dev.txt
    CalendarServer/trunk/twistedcaldav/storebridge.py

Modified: CalendarServer/trunk/requirements-dev.txt
===================================================================
--- CalendarServer/trunk/requirements-dev.txt	2016-02-15 16:02:00 UTC (rev 15462)
+++ CalendarServer/trunk/requirements-dev.txt	2016-02-15 16:03:00 UTC (rev 15463)
@@ -5,4 +5,4 @@
 q
 tl.eggdeps
 --editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVClientLibrary/trunk@15425#egg=CalDAVClientLibrary
---editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVTester/trunk@15425#egg=CalDAVTester
+--editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVTester/trunk@15462#egg=CalDAVTester

Modified: CalendarServer/trunk/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/storebridge.py	2016-02-15 16:02:00 UTC (rev 15462)
+++ CalendarServer/trunk/twistedcaldav/storebridge.py	2016-02-15 16:03:00 UTC (rev 15463)
@@ -655,6 +655,12 @@
         for index, component in indexedComponents:
 
             try:
+                if component is None:
+                    newchildURL = ""
+                    newchild = None
+                    changedComponent = None
+                    raise ValueError("Invalid component")
+
                 # Create a new name if one was not provided
                 name = hashlib.md5(str(index) + component.resourceUID() + str(time.time()) + request.path).hexdigest() + self.resourceSuffix()
 
@@ -701,7 +707,7 @@
                         davxml.PropertyStatus(
                             davxml.PropertyContainer(
                                 davxml.GETETag.fromString(etag.generate()),
-                                customxml.UID.fromString(component.resourceUID()),
+                                customxml.UID.fromString(component.resourceUID() if component else ""),
                             ),
                             davxml.Status.fromResponseCode(OK),
                         )
@@ -727,7 +733,7 @@
                     davxml.Status.fromResponseCode(code),
                     davxml.Error(
                         WebDAVUnknownElement.withName(*error),
-                        customxml.UID.fromString(component.resourceUID()),
+                        customxml.UID.fromString(component.resourceUID() if component else ""),
                     ) if error else None,
                 )
             )
@@ -818,7 +824,10 @@
             indexedComponents = []
             for index, xmldata in crudCreateInfo:
 
-                component = xmldata.generateComponent()
+                try:
+                    component = xmldata.generateComponent()
+                except:
+                    component = None
                 format = xmldata.content_type
 
                 if hasPrivilege is not True:
@@ -3345,6 +3354,12 @@
         for index, component in indexedComponents:
 
             try:
+                if component is None:
+                    newchildURL = ""
+                    newchild = None
+                    changedComponent = None
+                    raise ValueError("Invalid component")
+
                 # Create a new name if one was not provided
                 name = hashlib.md5(str(index) + component.resourceUID() + str(time.time()) + request.path).hexdigest() + self.resourceSuffix()
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20160215/05f2387e/attachment-0001.html>


More information about the calendarserver-changes mailing list