Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 56189 invoked from network); 11 Aug 2008 19:23:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Aug 2008 19:23:17 -0000 Received: (qmail 51217 invoked by uid 500); 11 Aug 2008 19:23:12 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 51196 invoked by uid 500); 11 Aug 2008 19:23:12 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 51185 invoked by uid 99); 11 Aug 2008 19:23:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Aug 2008 12:23:12 -0700 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jorton@redhat.com designates 66.187.233.31 as permitted sender) Received: from [66.187.233.31] (HELO mx1.redhat.com) (66.187.233.31) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Aug 2008 19:22:16 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m7BJKgZd027190 for ; Mon, 11 Aug 2008 15:20:42 -0400 Received: from file.rdu.redhat.com (file.rdu.redhat.com [10.11.255.147]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7BJKgEr010089 for ; Mon, 11 Aug 2008 15:20:42 -0400 Received: from turnip.manyfish.co.uk (vpn-12-14.rdu.redhat.com [10.11.12.14]) by file.rdu.redhat.com (8.13.1/8.13.1) with ESMTP id m7BJKfVv021160 for ; Mon, 11 Aug 2008 15:20:41 -0400 Received: from jorton by turnip.manyfish.co.uk with local (Exim 4.69) (envelope-from ) id 1KScwb-0008Lo-09 for dev@httpd.apache.org; Mon, 11 Aug 2008 20:20:41 +0100 Date: Mon, 11 Aug 2008 20:20:40 +0100 From: Joe Orton To: dev@httpd.apache.org Subject: Re: svn commit: r683626 - in /httpd/httpd/trunk: CHANGES modules/dav/fs/repos.c Message-ID: <20080811192040.GA4840@redhat.com> Mail-Followup-To: dev@httpd.apache.org References: <20080807151200.A751623889BB@eris.apache.org> <20080808092801.GA7196@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Organization: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in UK and Wales under Company Registration No. 03798903 Directors: Michael Cunningham (USA), Brendan Lane (Ireland), Matt Parson (USA), Charlie Peters (USA) X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Aug 08, 2008 at 09:42:01AM -0400, Jeff Trawick wrote: > On Fri, Aug 8, 2008 at 5:28 AM, Joe Orton wrote: > > On Thu, Aug 07, 2008 at 03:12:00PM -0000, Jeff Trawick wrote: > > > --- httpd/httpd/trunk/modules/dav/fs/repos.c (original) > > > +++ httpd/httpd/trunk/modules/dav/fs/repos.c Thu Aug 7 08:12:00 2008 > > > @@ -1475,10 +1475,8 @@ > > > /* append this file onto the path buffer (copy null term) */ > > > dav_buffer_place_mem(pool, &fsctx->path1, dirent.name, len + 1, > > 0); > > > > > > - > > > - /* ### Optimize me, dirent can give us what we need! */ > > > status = apr_stat(&fsctx->info1.finfo, fsctx->path1.buf, > > > - APR_FINFO_NORM | APR_FINFO_LINK, pool); > > > + APR_FINFO_TYPE | APR_FINFO_LINK, pool); > > > if (status != APR_SUCCESS && status != APR_INCOMPLETE) { > > > /* woah! where'd it go? */ > > > /* ### should have a better error here */ > > > > > > > Nit pick: on Unix APR_FINFO_PROT is needed too, to support the > > executable property.... > > plz show me where; I'm blind; thanks! If I'm understanding things correctly, this stat() call fetches file attributes which will be used when returning property information via dav_fs_insert_prop. So I think that the stat() call should mask in all the attribute types which are used in dav_fs_insert_prop: ctime, mtime, size, and prot iff !WIN32. Here is a good demo - change APR file_io/unix/filestat.c as below: static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info, apr_int32_t wanted) { #if 0 finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_OWNER | APR_FINFO_PROT; #else finfo->valid = wanted; #endif i.e. lose all the file attributes which come for free with stat() but weren't explicitly requested; you'll see that mod_dav no longer returns the executable property. (with cadaver, for an existing foo.txt on the server, "chexec + foo.txt" then see whether the "*" shows up next to foo.txt in a subsequent "ls") I think that something like this is the way to go: (against 2.2.x since my trunk install is currently refusing to do anything DAVy) --- repos.c (revision 683918) +++ repos.c (working copy) @@ -119,9 +119,19 @@ ** Does this platform support an executable flag? ** ** ### need a way to portably abstract this query +** +** DAV_FINFO_MASK gives the appropriate mask to use for the stat call +** used to get file attributes. */ #ifndef WIN32 #define DAV_FS_HAS_EXECUTABLE +#define DAV_FINFO_MASK (APR_FINFO_LINK | APR_FINFO_TYPE | APR_FINFO_INODE | \ + APR_FINFO_SIZE | APR_FINFO_CTIME | APR_FINFO_MTIME) +#else +/* as above plus APR_FINFO_PROT */ +#define DAV_FINFO_MASK (APR_FINFO_LINK | APR_FINFO_TYPE | APR_FINFO_INODE | \ + APR_FINFO_SIZE | APR_FINFO_CTIME | APR_FINFO_MTIME \ + APR_FINFO_PROT) #endif /* @@ -1482,7 +1492,7 @@ /* ### Optimize me, dirent can give us what we need! */ status = apr_stat(&fsctx->info1.finfo, fsctx->path1.buf, - APR_FINFO_NORM | APR_FINFO_LINK, pool); + DAV_FINFO_MASK, pool); if (status != APR_SUCCESS && status != APR_INCOMPLETE) { /* woah! where'd it go? */ /* ### should have a better error here */