From nobody@FreeBSD.org  Tue Nov  5 15:39:44 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 63B50F12
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  5 Nov 2013 15:39:44 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 5182C2093
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  5 Nov 2013 15:39:44 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rA5FdiZ8029704
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 5 Nov 2013 15:39:44 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rA5FdifH029703;
	Tue, 5 Nov 2013 15:39:44 GMT
	(envelope-from nobody)
Message-Id: <201311051539.rA5FdifH029703@oldred.freebsd.org>
Date: Tue, 5 Nov 2013 15:39:44 GMT
From: Pietro Cerutti <gahr@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] www/apache22 -- backport of mod_dav r1528718
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         183685
>Category:       ports
>Synopsis:       [patch] www/apache22 -- backport of mod_dav r1528718
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    apache
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 05 15:40:00 UTC 2013
>Closed-Date:    Tue Nov 05 22:56:06 UTC 2013
>Last-Modified:  Tue Nov 05 22:56:06 UTC 2013
>Originator:     Pietro Cerutti
>Release:        
>Organization:
The FreeBSD Project
>Environment:
>Description:
This patch is a backport of commit r1528718 into mod_dav [1]. This is needed because of a bug [2] due to an incorrect implementation of RFC 4918.

The symptoms are a failure to copy a svn tree via DAV:

[Tue Nov 05 15:20:49 2013] [error] [client 192.168.250.200] Could not COPY /path/to/copy due to a failed precondition on the source (e.g. locks).  [500, #0]
[Tue Nov 05 15:20:49 2013] [error] [client 192.168.250.200] The locks could not be queried for verification against a possible "If:" header.  [500, #0]
[Tue Nov 05 15:20:49 2013] [error] [client 192.168.250.200] Path is not accessible.  [403, #405]


[1] http://svn.apache.org/viewvc?view=revision&revision=1528718
[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=55306
>How-To-Repeat:

>Fix:
The attached diff adds a patch to www/apache22.

Patch attached with submission follows:

Index: files/patch-bug-55306
===================================================================
--- files/patch-bug-55306	(revision 0)
+++ files/patch-bug-55306	(working copy)
@@ -0,0 +1,46 @@
+--- modules/dav/main/mod_dav.c.orig	2013-06-27 18:54:14.000000000 +0200
++++ modules/dav/main/mod_dav.c	2013-11-05 16:31:51.000000000 +0100
+@@ -2733,7 +2733,9 @@
+      */
+     if ((err = dav_validate_request(r, resource, depth, NULL,
+                                     &multi_response,
+-                                    DAV_VALIDATE_PARENT
++                                    (is_move ? DAV_VALIDATE_PARENT
++                                         :DAV_VALIDATE_RESOURCE
++                                          |DAV_VALIDATE_NO_MODIFY)
+                                     | DAV_VALIDATE_USE_424,
+                                     NULL)) != NULL) {
+         err = dav_push_error(r->pool, err->status, 0,
+--- modules/dav/main/mod_dav.h.orig	2013/10/03 05:06:08	1528717
++++ modules/dav/main/mod_dav.h	2013/10/03 05:29:35	1528718
+@@ -1297,6 +1297,9 @@
+                                            the 424 DAV:response */
+ #define DAV_VALIDATE_USE_424    0x0080  /* return 424 status, not 207 */
+ #define DAV_VALIDATE_IS_PARENT  0x0100  /* for internal use */
++#define DAV_VALIDATE_NO_MODIFY  0x0200  /* resource is not being modified
++                                           so allow even if lock token
++                                           is not provided */
+ 
+ /* Lock-null related public lock functions */
+ DAV_DECLARE(int) dav_get_resource_state(request_rec *r,
+--- modules/dav/main/util.c.orig	2013/10/03 05:06:08	1528717
++++ modules/dav/main/util.c	2013/10/03 05:29:35	1528718
+@@ -954,13 +954,16 @@
+         /*
+         ** For methods other than LOCK:
+         **
+-        ** If we have no locks, then <seen_locktoken> can be set to true --
++        ** If we have no locks or if the resource is not being modified
++        ** (per RFC 4918 the lock token is not required on resources
++        ** we are not changing), then <seen_locktoken> can be set to true --
+         ** pretending that we've already met the requirement of seeing one
+         ** of the resource's locks in the If: header.
+         **
+         ** Otherwise, it must be cleared and we'll look for one.
+         */
+-        seen_locktoken = (lock_list == NULL);
++        seen_locktoken = (lock_list == NULL
++                          || flags & DAV_VALIDATE_NO_MODIFY);
+     }
+ 
+     /*

Property changes on: files/patch-bug-55306
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->apache 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Nov 5 15:40:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183685 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/183685: commit references a PR
Date: Tue,  5 Nov 2013 22:00:15 +0000 (UTC)

 Author: ohauer
 Date: Tue Nov  5 22:00:07 2013
 New Revision: 332914
 URL: http://svnweb.freebsd.org/changeset/ports/332914
 
 Log:
   - backport upstream commit r1528718 into mod_dav [1].
     This is needed because of a bug [2] due to an incorrect
     implementation of RFC 4918.
     The symptoms are a failure to copy a svn tree via DAV:
   
   - fix package installation with old pkg tools (create empty
     folders in pkg-plist even staging is enabled)
   
   [1] http://svn.apache.org/viewvc?view=revision&revision=1528718
   [2] https://issues.apache.org/bugzilla/show_bug.cgi?id=55306
   
   PR:		ports/183685
   Submitted by:	Pietro Cerutti <gahr@FreeBSD.org>
 
 Added:
   head/www/apache22/files/patch-bug-55306   (contents, props changed)
 Modified:
   head/www/apache22/Makefile
   head/www/apache22/pkg-plist
 
 Modified: head/www/apache22/Makefile
 ==============================================================================
 --- head/www/apache22/Makefile	Tue Nov  5 21:57:16 2013	(r332913)
 +++ head/www/apache22/Makefile	Tue Nov  5 22:00:07 2013	(r332914)
 @@ -2,7 +2,7 @@
  
  PORTNAME=	apache22
  PORTVERSION=	2.2.25
 -#PORTREVISION?=	1
 +PORTREVISION?=	1
  CATEGORIES=	www ipv6
  MASTER_SITES=	${MASTER_SITE_APACHE_HTTPD}
  DISTNAME=	httpd-${PORTVERSION}
 
 Added: head/www/apache22/files/patch-bug-55306
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/www/apache22/files/patch-bug-55306	Tue Nov  5 22:00:07 2013	(r332914)
 @@ -0,0 +1,50 @@
 +PR: ports/183685
 +[1] http://svn.apache.org/viewvc?view=revision&revision=1528718
 +[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=55306
 +===========================================================================
 +--- modules/dav/main/mod_dav.c.orig	2013-06-27 18:54:14.000000000 +0200
 ++++ modules/dav/main/mod_dav.c	2013-11-05 16:31:51.000000000 +0100
 +@@ -2733,7 +2733,9 @@
 +      */
 +     if ((err = dav_validate_request(r, resource, depth, NULL,
 +                                     &multi_response,
 +-                                    DAV_VALIDATE_PARENT
 ++                                    (is_move ? DAV_VALIDATE_PARENT
 ++                                         :DAV_VALIDATE_RESOURCE
 ++                                          |DAV_VALIDATE_NO_MODIFY)
 +                                     | DAV_VALIDATE_USE_424,
 +                                     NULL)) != NULL) {
 +         err = dav_push_error(r->pool, err->status, 0,
 +--- modules/dav/main/mod_dav.h.orig	2013/10/03 05:06:08	1528717
 ++++ modules/dav/main/mod_dav.h	2013/10/03 05:29:35	1528718
 +@@ -1297,6 +1297,9 @@
 +                                            the 424 DAV:response */
 + #define DAV_VALIDATE_USE_424    0x0080  /* return 424 status, not 207 */
 + #define DAV_VALIDATE_IS_PARENT  0x0100  /* for internal use */
 ++#define DAV_VALIDATE_NO_MODIFY  0x0200  /* resource is not being modified
 ++                                           so allow even if lock token
 ++                                           is not provided */
 + 
 + /* Lock-null related public lock functions */
 + DAV_DECLARE(int) dav_get_resource_state(request_rec *r,
 +--- modules/dav/main/util.c.orig	2013/10/03 05:06:08	1528717
 ++++ modules/dav/main/util.c	2013/10/03 05:29:35	1528718
 +@@ -954,13 +954,16 @@
 +         /*
 +         ** For methods other than LOCK:
 +         **
 +-        ** If we have no locks, then <seen_locktoken> can be set to true --
 ++        ** If we have no locks or if the resource is not being modified
 ++        ** (per RFC 4918 the lock token is not required on resources
 ++        ** we are not changing), then <seen_locktoken> can be set to true --
 +         ** pretending that we've already met the requirement of seeing one
 +         ** of the resource's locks in the If: header.
 +         **
 +         ** Otherwise, it must be cleared and we'll look for one.
 +         */
 +-        seen_locktoken = (lock_list == NULL);
 ++        seen_locktoken = (lock_list == NULL
 ++                          || flags & DAV_VALIDATE_NO_MODIFY);
 +     }
 + 
 +     /*
 
 Modified: head/www/apache22/pkg-plist
 ==============================================================================
 --- head/www/apache22/pkg-plist	Tue Nov  5 21:57:16 2013	(r332913)
 +++ head/www/apache22/pkg-plist	Tue Nov  5 22:00:07 2013	(r332914)
 @@ -1,4 +1,8 @@
  @comment $FreeBSD$
 +@comment keep the next three lines on top (only required for old pkg_... tools)
 +@exec mkdir -p %D/%%ETCDIR%%/envvars.d 2> /dev/null || true
 +@exec mkdir -p %D/%%ETCDIR%%/extra 2> /dev/null || true
 +@exec mkdir -p %D/%%ETCDIR%%/Includes 2> /dev/null || true
  %%ETCDIR%%/Includes/no-accf.conf
  include/apache22/ap_compat.h
  include/apache22/ap_config.h
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: ohauer 
State-Changed-When: Tue Nov 5 22:55:41 UTC 2013 
State-Changed-Why:  
Committed,  
Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183685 
>Unformatted:
