You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2021/09/25 21:47:52 UTC

svn commit: r1893629 - /httpd/httpd/patches/2.4.x/httpd-2.4-dav-ns.patch

Author: minfrin
Date: Sat Sep 25 21:47:52 2021
New Revision: 1893629

URL: http://svn.apache.org/viewvc?rev=1893629&view=rev
Log:
Add backport for r1879888.

Added:
    httpd/httpd/patches/2.4.x/httpd-2.4-dav-ns.patch

Added: httpd/httpd/patches/2.4.x/httpd-2.4-dav-ns.patch
URL: http://svn.apache.org/viewvc/httpd/httpd/patches/2.4.x/httpd-2.4-dav-ns.patch?rev=1893629&view=auto
==============================================================================
--- httpd/httpd/patches/2.4.x/httpd-2.4-dav-ns.patch (added)
+++ httpd/httpd/patches/2.4.x/httpd-2.4-dav-ns.patch Sat Sep 25 21:47:52 2021
@@ -0,0 +1,300 @@
+Index: changes-entries/mod_dav-ns.txt
+===================================================================
+--- changes-entries/mod_dav-ns.txt	(nonexistent)
++++ changes-entries/mod_dav-ns.txt	(working copy)
+@@ -0,0 +1,6 @@
++
++  *) mod_dav: Add utility functions dav_validate_root_ns(),
++     dav_find_child_ns(), dav_find_next_ns(), dav_find_attr_ns() and
++     dav_find_attr() so that other modules get to play too.
++     [Graham Leggett]
++
+Index: include/ap_mmn.h
+===================================================================
+--- include/ap_mmn.h	(revision 1893628)
++++ include/ap_mmn.h	(working copy)
+@@ -578,6 +578,9 @@
+  * 20120211.115 (2.4.49-dev) Add ap_proxy_get_worker_ex() and
+  *                           ap_proxy_define_worker_ex() to mod_proxy.h
+  * 20120211.116 (2.4.49-dev) add conn_rec->outgoing and ap_ssl_bind_outgoing()
++ * 20120211.117 (2.4.50-dev) Add dav_validate_root_ns(), dav_find_child_ns(),
++ *                           dav_find_next_ns(), dav_find_attr_ns() and
++ *                           dav_find_attr().
+  */
+ 
+ #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
+@@ -585,7 +588,7 @@
+ #ifndef MODULE_MAGIC_NUMBER_MAJOR
+ #define MODULE_MAGIC_NUMBER_MAJOR 20120211
+ #endif
+-#define MODULE_MAGIC_NUMBER_MINOR 116                 /* 0...n */
++#define MODULE_MAGIC_NUMBER_MINOR 117                 /* 0...n */
+ 
+ /**
+  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+Index: modules/dav/main/mod_dav.h
+===================================================================
+--- modules/dav/main/mod_dav.h	(revision 1893628)
++++ modules/dav/main/mod_dav.h	(working copy)
+@@ -577,9 +577,23 @@
+ 
+ DAV_DECLARE(int) dav_validate_root(const apr_xml_doc *doc,
+                                    const char *tagname);
++DAV_DECLARE(int) dav_validate_root_ns(const apr_xml_doc *doc,
++                                      int ns, const char *tagname);
+ DAV_DECLARE(apr_xml_elem *) dav_find_child(const apr_xml_elem *elem,
+                                            const char *tagname);
++DAV_DECLARE(apr_xml_elem *) dav_find_child_ns(const apr_xml_elem *elem,
++                                              int ns, const char *tagname);
++DAV_DECLARE(apr_xml_elem *) dav_find_next_ns(const apr_xml_elem *elem,
++                                             int ns, const char *tagname);
+ 
++/* find and return the attribute with a name in the given namespace */
++DAV_DECLARE(apr_xml_attr *) dav_find_attr_ns(const apr_xml_elem *elem,
++                                             int ns, const char *attrname);
++
++/* find and return the attribute with a given DAV: tagname */
++DAV_DECLARE(apr_xml_attr *) dav_find_attr(const apr_xml_elem *elem,
++                                          const char *attrname);
++
+ /* gather up all the CDATA into a single string */
+ DAV_DECLARE(const char *) dav_xml_get_cdata(const apr_xml_elem *elem, apr_pool_t *pool,
+                               int strip_white);
+Index: modules/dav/main/util.c
+===================================================================
+--- modules/dav/main/util.c	(revision 1893628)
++++ modules/dav/main/util.c	(working copy)
+@@ -316,26 +316,71 @@
+ */
+ 
+ /* validate that the root element uses a given DAV: tagname (TRUE==valid) */
+-DAV_DECLARE(int) dav_validate_root(const apr_xml_doc *doc,
+-                                   const char *tagname)
++DAV_DECLARE(int) dav_validate_root_ns(const apr_xml_doc *doc,
++                                      int ns, const char *tagname)
+ {
+     return doc->root &&
+-        doc->root->ns == APR_XML_NS_DAV_ID &&
++        doc->root->ns == ns &&
+         strcmp(doc->root->name, tagname) == 0;
+ }
+ 
+-/* find and return the (unique) child with a given DAV: tagname */
+-DAV_DECLARE(apr_xml_elem *) dav_find_child(const apr_xml_elem *elem,
+-                                           const char *tagname)
++/* validate that the root element uses a given DAV: tagname (TRUE==valid) */
++DAV_DECLARE(int) dav_validate_root(const apr_xml_doc *doc,
++                                   const char *tagname)
+ {
++	return dav_validate_root_ns(doc, APR_XML_NS_DAV_ID, tagname);
++}
++
++/* find and return the next child with a tagname in the given namespace */
++DAV_DECLARE(apr_xml_elem *) dav_find_next_ns(const apr_xml_elem *elem,
++                                             int ns, const char *tagname)
++{
++    apr_xml_elem *child = elem->next;
++
++    for (; child; child = child->next)
++        if (child->ns == ns && !strcmp(child->name, tagname))
++            return child;
++    return NULL;
++}
++
++/* find and return the (unique) child with a tagname in the given namespace */
++DAV_DECLARE(apr_xml_elem *) dav_find_child_ns(const apr_xml_elem *elem,
++                                              int ns, const char *tagname)
++{
+     apr_xml_elem *child = elem->first_child;
+ 
+     for (; child; child = child->next)
+-        if (child->ns == APR_XML_NS_DAV_ID && !strcmp(child->name, tagname))
++        if (child->ns == ns && !strcmp(child->name, tagname))
+             return child;
+     return NULL;
+ }
+ 
++/* find and return the (unique) child with a given DAV: tagname */
++DAV_DECLARE(apr_xml_elem *) dav_find_child(const apr_xml_elem *elem,
++                                           const char *tagname)
++{
++	return dav_find_child_ns(elem, APR_XML_NS_DAV_ID, tagname);
++}
++
++/* find and return the attribute with a name in the given namespace */
++DAV_DECLARE(apr_xml_attr *) dav_find_attr_ns(const apr_xml_elem *elem,
++                                             int ns, const char *attrname)
++{
++    apr_xml_attr *attr = elem->attr;
++
++    for (; attr; attr = attr->next)
++        if (attr->ns == ns && !strcmp(attr->name, attrname))
++            return attr;
++    return NULL;
++}
++
++/* find and return the attribute with a given DAV: tagname */
++DAV_DECLARE(apr_xml_attr *) dav_find_attr(const apr_xml_elem *elem,
++                                          const char *attrname)
++{
++	return dav_find_attr_ns(elem, APR_XML_NS_DAV_ID, attrname);
++}
++
+ /* gather up all the CDATA into a single string */
+ DAV_DECLARE(const char *) dav_xml_get_cdata(const apr_xml_elem *elem, apr_pool_t *pool,
+                               int strip_white)
+Index: .
+===================================================================
+--- .	(revision 1893628)
++++ .	(working copy)
+
+Property changes on: .
+___________________________________________________________________
+Modified: svn:mergeinfo
+## -0,0 +0,1 ##
+   Merged /httpd/httpd/trunk:r1879888
+Index: changes-entries/mod_dav-ns.txt
+===================================================================
+--- changes-entries/mod_dav-ns.txt	(nonexistent)
++++ changes-entries/mod_dav-ns.txt	(working copy)
+@@ -0,0 +1,6 @@
++
++  *) mod_dav: Add utility functions dav_validate_root_ns(),
++     dav_find_child_ns(), dav_find_next_ns(), dav_find_attr_ns() and
++     dav_find_attr() so that other modules get to play too.
++     [Graham Leggett]
++
+Index: include/ap_mmn.h
+===================================================================
+--- include/ap_mmn.h	(revision 1893628)
++++ include/ap_mmn.h	(working copy)
+@@ -578,6 +578,9 @@
+  * 20120211.115 (2.4.49-dev) Add ap_proxy_get_worker_ex() and
+  *                           ap_proxy_define_worker_ex() to mod_proxy.h
+  * 20120211.116 (2.4.49-dev) add conn_rec->outgoing and ap_ssl_bind_outgoing()
++ * 20120211.117 (2.4.50-dev) Add dav_validate_root_ns(), dav_find_child_ns(),
++ *                           dav_find_next_ns(), dav_find_attr_ns() and
++ *                           dav_find_attr().
+  */
+ 
+ #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
+@@ -585,7 +588,7 @@
+ #ifndef MODULE_MAGIC_NUMBER_MAJOR
+ #define MODULE_MAGIC_NUMBER_MAJOR 20120211
+ #endif
+-#define MODULE_MAGIC_NUMBER_MINOR 116                 /* 0...n */
++#define MODULE_MAGIC_NUMBER_MINOR 117                 /* 0...n */
+ 
+ /**
+  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+Index: modules/dav/main/mod_dav.h
+===================================================================
+--- modules/dav/main/mod_dav.h	(revision 1893628)
++++ modules/dav/main/mod_dav.h	(working copy)
+@@ -577,9 +577,23 @@
+ 
+ DAV_DECLARE(int) dav_validate_root(const apr_xml_doc *doc,
+                                    const char *tagname);
++DAV_DECLARE(int) dav_validate_root_ns(const apr_xml_doc *doc,
++                                      int ns, const char *tagname);
+ DAV_DECLARE(apr_xml_elem *) dav_find_child(const apr_xml_elem *elem,
+                                            const char *tagname);
++DAV_DECLARE(apr_xml_elem *) dav_find_child_ns(const apr_xml_elem *elem,
++                                              int ns, const char *tagname);
++DAV_DECLARE(apr_xml_elem *) dav_find_next_ns(const apr_xml_elem *elem,
++                                             int ns, const char *tagname);
+ 
++/* find and return the attribute with a name in the given namespace */
++DAV_DECLARE(apr_xml_attr *) dav_find_attr_ns(const apr_xml_elem *elem,
++                                             int ns, const char *attrname);
++
++/* find and return the attribute with a given DAV: tagname */
++DAV_DECLARE(apr_xml_attr *) dav_find_attr(const apr_xml_elem *elem,
++                                          const char *attrname);
++
+ /* gather up all the CDATA into a single string */
+ DAV_DECLARE(const char *) dav_xml_get_cdata(const apr_xml_elem *elem, apr_pool_t *pool,
+                               int strip_white);
+Index: modules/dav/main/util.c
+===================================================================
+--- modules/dav/main/util.c	(revision 1893628)
++++ modules/dav/main/util.c	(working copy)
+@@ -316,26 +316,71 @@
+ */
+ 
+ /* validate that the root element uses a given DAV: tagname (TRUE==valid) */
+-DAV_DECLARE(int) dav_validate_root(const apr_xml_doc *doc,
+-                                   const char *tagname)
++DAV_DECLARE(int) dav_validate_root_ns(const apr_xml_doc *doc,
++                                      int ns, const char *tagname)
+ {
+     return doc->root &&
+-        doc->root->ns == APR_XML_NS_DAV_ID &&
++        doc->root->ns == ns &&
+         strcmp(doc->root->name, tagname) == 0;
+ }
+ 
+-/* find and return the (unique) child with a given DAV: tagname */
+-DAV_DECLARE(apr_xml_elem *) dav_find_child(const apr_xml_elem *elem,
+-                                           const char *tagname)
++/* validate that the root element uses a given DAV: tagname (TRUE==valid) */
++DAV_DECLARE(int) dav_validate_root(const apr_xml_doc *doc,
++                                   const char *tagname)
+ {
++	return dav_validate_root_ns(doc, APR_XML_NS_DAV_ID, tagname);
++}
++
++/* find and return the next child with a tagname in the given namespace */
++DAV_DECLARE(apr_xml_elem *) dav_find_next_ns(const apr_xml_elem *elem,
++                                             int ns, const char *tagname)
++{
++    apr_xml_elem *child = elem->next;
++
++    for (; child; child = child->next)
++        if (child->ns == ns && !strcmp(child->name, tagname))
++            return child;
++    return NULL;
++}
++
++/* find and return the (unique) child with a tagname in the given namespace */
++DAV_DECLARE(apr_xml_elem *) dav_find_child_ns(const apr_xml_elem *elem,
++                                              int ns, const char *tagname)
++{
+     apr_xml_elem *child = elem->first_child;
+ 
+     for (; child; child = child->next)
+-        if (child->ns == APR_XML_NS_DAV_ID && !strcmp(child->name, tagname))
++        if (child->ns == ns && !strcmp(child->name, tagname))
+             return child;
+     return NULL;
+ }
+ 
++/* find and return the (unique) child with a given DAV: tagname */
++DAV_DECLARE(apr_xml_elem *) dav_find_child(const apr_xml_elem *elem,
++                                           const char *tagname)
++{
++	return dav_find_child_ns(elem, APR_XML_NS_DAV_ID, tagname);
++}
++
++/* find and return the attribute with a name in the given namespace */
++DAV_DECLARE(apr_xml_attr *) dav_find_attr_ns(const apr_xml_elem *elem,
++                                             int ns, const char *attrname)
++{
++    apr_xml_attr *attr = elem->attr;
++
++    for (; attr; attr = attr->next)
++        if (attr->ns == ns && !strcmp(attr->name, attrname))
++            return attr;
++    return NULL;
++}
++
++/* find and return the attribute with a given DAV: tagname */
++DAV_DECLARE(apr_xml_attr *) dav_find_attr(const apr_xml_elem *elem,
++                                          const char *attrname)
++{
++	return dav_find_attr_ns(elem, APR_XML_NS_DAV_ID, attrname);
++}
++
+ /* gather up all the CDATA into a single string */
+ DAV_DECLARE(const char *) dav_xml_get_cdata(const apr_xml_elem *elem, apr_pool_t *pool,
+                               int strip_white)