Re: DAV Option Patch

2009-09-16 Thread Jari Urpalainen
On Wed, 2009-09-16 at 11:39 +0200, ext Joe Orton wrote:
> On Wed, Sep 16, 2009 at 10:09:23AM +0300, Jari Urpalainen wrote:
> > I'll assume that you don't need here the content which is included
> > within mod_dav_acl package at sf.net ? Otherwise you are certainly free
> > to use it anyways you like. Patch contains mostly some "hooks" to
> > mod_dav, but since i'm not that familiar with apr & apache code, you can
> > certainly improve things. For dav_acl, caldav and carddav modules (the
> > latter of which i just recently submitted), only similar kind of things
> > are needed, so you can change the api freely as long as the
> > functionality remains. I do have some cycles to update my modules
> > accordingly. What comes to having included these with httpd, I'm in the
> > process of asking permission from my company the change the license to
> > APL
> 
> If you can submit the patches to the ASF under the Apache Software 
> License, it is sufficient for you to send them to this mailing list - 
> that counts as a "contribution to the ASF".  
> 
> If you can do that, we can then include the patches in the tree, but if 
> your employer owns the copyright to the patches, then be sure you are 
> authorized to submit the code under that license first.
> 
> Regards, Joe

Ok, here's the patch (which I'm authorized to submit). And yes you can
apply the Apache License, Version 2.0 or what is the official name.

thanks Jari
diff -Naur httpd-2.2.8/modules/dav/fs/repos.c httpd-2.2.8-ju/modules/dav/fs/repos.c
--- httpd-2.2.8/modules/dav/fs/repos.c	2008-06-04 10:53:04.0 +0300
+++ httpd-2.2.8-ju/modules/dav/fs/repos.c	2008-07-02 10:17:47.0 +0300
@@ -46,6 +46,7 @@
 apr_pool_t *pool;/* memory storage pool associated with request */
 const char *pathname;   /* full pathname to resource */
 apr_finfo_t finfo;   /* filesystem info */
+request_rec *r;
 };
 
 /* private context for doing a filesystem walk */
@@ -200,6 +201,11 @@
 **
 ** PRIVATE REPOSITORY FUNCTIONS
 */
+request_rec *dav_fs_get_request_rec(const dav_resource *resource)
+{
+return resource->info->r;
+}
+
 apr_pool_t *dav_fs_pool(const dav_resource *resource)
 {
 return resource->info->pool;
@@ -638,6 +644,7 @@
 /* Create private resource context descriptor */
 ctx = apr_pcalloc(r->pool, sizeof(*ctx));
 ctx->finfo = r->finfo;
+ctx->r = r;
 
 /* ### this should go away */
 ctx->pool = r->pool;
@@ -1775,17 +1782,13 @@
 
 if (!resource->exists)
 return apr_pstrdup(ctx->pool, "");
+{
+  	request_rec *r = ctx->r;
 
-if (ctx->finfo.filetype != 0) {
-return apr_psprintf(ctx->pool, "\"%" APR_UINT64_T_HEX_FMT "-%"
-APR_UINT64_T_HEX_FMT "-%" APR_UINT64_T_HEX_FMT "\"",
-(apr_uint64_t) ctx->finfo.inode,
-(apr_uint64_t) ctx->finfo.size,
-(apr_uint64_t) ctx->finfo.mtime);
-}
-
-return apr_psprintf(ctx->pool, "\"%" APR_UINT64_T_HEX_FMT "\"",
-   (apr_uint64_t) ctx->finfo.mtime);
+	r->mtime = ctx->finfo.mtime;
+r->finfo = ctx->finfo;
+  	return ap_make_etag(r, 0);
+} 	
 }
 
 static const dav_hooks_repository dav_hooks_repository_fs =
@@ -1812,6 +1815,9 @@
 dav_fs_remove_resource,
 dav_fs_walk,
 dav_fs_getetag,
+dav_fs_get_request_rec,
+dav_fs_pathname,
+NULL
 };
 
 static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource,
diff -Naur httpd-2.2.8/modules/dav/main/mod_dav.c httpd-2.2.8-ju/modules/dav/main/mod_dav.c
--- httpd-2.2.8/modules/dav/main/mod_dav.c	2008-06-04 10:53:04.0 +0300
+++ httpd-2.2.8-ju/modules/dav/main/mod_dav.c	2008-07-02 10:24:09.0 +0300
@@ -57,6 +57,8 @@
 #include "http_request.h"
 #include "util_script.h"
 
+#include "ap_provider.h"
+
 #include "mod_dav.h"
 
 
@@ -79,6 +81,8 @@
 const char *dir;
 int locktimeout;
 int allow_depthinfinity;
+int acl_checking;
+int etag_response;  
 
 } dav_dir_conf;
 
@@ -195,10 +199,18 @@
 newconf->dir = DAV_INHERIT_VALUE(parent, child, dir);
 newconf->allow_depthinfinity = DAV_INHERIT_VALUE(parent, child,
  allow_depthinfinity);
+newconf->acl_checking = DAV_INHERIT_VALUE(parent, child, acl_checking);
+newconf->etag_response = DAV_INHERIT_VALUE(parent, child, etag_response);
 
 return newconf;
 }
 
+DAV_DECLARE(const char *) dav_get_provider_name(request_rec *r)
+{
+dav_dir_conf *conf = ap_get_module_config(r->per_dir_config, &dav_module);
+return

Re: DAV Option Patch

2009-09-16 Thread Jari Urpalainen
On Tue, 2009-09-15 at 18:42 +0200, ext Julian Reschke wrote:
> Brian J. France wrote:
> > ...
> > There is one draw back to this patch in that there could be duplicated 
> > values in the headers.  Both mod_dav_acl and mod_caldav want to add the 
> > REPORT in the Allow header, so it would show up twice in the list.  I am 
> > not sure if this is a major problem, but wanted to make a note of it.
> > ...
> 
> It shouldn't be a problem, but on the other hand: is there any 
> particular reason for the new code not to enforce each value is only 
> reported once?
> 
> BR, Julian

Nothing at all, since it is trivial to fix it so (originally i didn't
bother to do that since I knew clients don't mind...)

br, Jari



Re: DAV Option Patch

2009-09-16 Thread Jari Urpalainen
On Tue, 2009-09-15 at 11:25 +0200, ext Graham Leggett wrote:
> Brian J. France wrote:
> 
> > Jari is the original author of mod_dav_acl, which requires patches to
> > httpd to work.  I need the same functionality added to httpd to get a
> > mod_dav_acl type module working, so I have split up his patch into
> > smaller pieces.  Can a patch be under a different license than the
> > original code?
> 
> Yes it can, but only the author of the original code can do that, as
> only the original author (the copyright holder) can set the terms by
> which his patch can be used.
> 
> The way forward is to ask Jari to submit his httpd-2.2.8-ju.patch to us,
> granting us permission to use the Apache software license on it.

I'll assume that you don't need here the content which is included
within mod_dav_acl package at sf.net ? Otherwise you are certainly free
to use it anyways you like. Patch contains mostly some "hooks" to
mod_dav, but since i'm not that familiar with apr & apache code, you can
certainly improve things. For dav_acl, caldav and carddav modules (the
latter of which i just recently submitted), only similar kind of things
are needed, so you can change the api freely as long as the
functionality remains. I do have some cycles to update my modules
accordingly. What comes to having included these with httpd, I'm in the
process of asking permission from my company the change the license to
APL

Thanks, Jari



mod_dav_acl

2007-04-19 Thread Jari Urpalainen
Hi !

I've written an rfc3744 (ACL) implementation on top of mod_dav module
(mod_dav_acl: linux, LGPL license, available at
). As I wanted not to
reinvent the wheel I've added some hooks onto the mod_dav module and
changed some apis into public ones. Patch for mod_dav module (and some
fixes to base Apache) is available in the source tarball (some patches
needed by rfc4791/CalDAV implementation available at
). Any chance or interest
into getting these patches (or something similar) into the mainline of
mod_dav ?

The acl implementation works along with the standard filesystem
provider. I heard that Subversion developers has some plans on
implementing rfc3744 as well. At this point I would be very pleased to
have the needed hooks there in mod_dav but even greater integration
aren't out of the scope. However, I personally don't have much interest
beyond linux which this implementation is dependent on and currently
also depends on extended attribute support on the filesystem.

br, Jari