You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by James Ralston <qr...@andrew.cmu.edu> on 2009/05/15 03:05:00 UTC

bug: null user passed to pre-revprop-change when using WebDAV?

[I submitted this to the users list on 2009-05-01, but received no
responses.]

Consider the follow pre-revprop-change hook script:

    #! /bin/sh
    exec 1>`mktemp -t revprop-change-XXXXXXXX` 2>&1
    set -x
    echo "$@"
    exit 0

When accessing the repository via the local filesystem, the output
produced when the hook script is invoked to process this command:

    $ svn propedit -r HEAD --revprop svn:log \
      file:///home/testuser/repo/test

Is:

    + echo /home/testuser/repo/test 1 testuser svn:log M
    /home/testuser/repo/test 1 testuser svn:log M
    + exit 0

But when I instead edit a property via WebDAV, like this:

    $ svn propedit -r HEAD --revprop svn:log \
      http://svn.example.com/test/

When the hook script fires, the output is:

    + echo /var/www/svn/repo/test 70 '' svn:log M
    /var/www/svn/repo/test 70  svn:log M
    + exit 0

Instead of passing in the user to the hook script, Subversion passed
in a null string.

In both cases, the version of Subversion is the same: 1.4.2 (as
packaged by Red Hat for RHEL5).

Is this a known bug with mod_dav_svn?  (I searched the bug tracker,
but couldn't find anything that seemed relevant.)

If this is a bug, is it fixed in a later version of Subversion?

(In case anyone's wondering, the post-revprop-change hook script has
the exact same bug...)


Re: bug: null user passed to pre-revprop-change when using WebDAV?

Posted by "C. Michael Pilato" <cm...@collab.net>.
James Ralston wrote:
> [I submitted this to the users list on 2009-05-01, but received no
> responses.]
> 
> Consider the follow pre-revprop-change hook script:
> 
>     #! /bin/sh
>     exec 1>`mktemp -t revprop-change-XXXXXXXX` 2>&1
>     set -x
>     echo "$@"
>     exit 0
> 
> When accessing the repository via the local filesystem, the output
> produced when the hook script is invoked to process this command:
> 
>     $ svn propedit -r HEAD --revprop svn:log \
>       file:///home/testuser/repo/test
> 
> Is:
> 
>     + echo /home/testuser/repo/test 1 testuser svn:log M
>     /home/testuser/repo/test 1 testuser svn:log M
>     + exit 0
> 
> But when I instead edit a property via WebDAV, like this:
> 
>     $ svn propedit -r HEAD --revprop svn:log \
>       http://svn.example.com/test/
> 
> When the hook script fires, the output is:
> 
>     + echo /var/www/svn/repo/test 70 '' svn:log M
>     /var/www/svn/repo/test 70  svn:log M
>     + exit 0
> 
> Instead of passing in the user to the hook script, Subversion passed
> in a null string.

Technically (in C-speak), Subversion supplies an empty string, not a NULL one.

What you are seeing is not a bug, though.  It's the expected result of you
apparently running a WebDAV server which requires no authentication.  The
Apache auth model -- and Subversion's fit inside of it -- is such that any
operation that doesn't explicitly require authentication will be performed
without out.  No authentication means Apache (and Subversion/mod_dav_svn by
extension) has no username to work with.  Subversion only applies such a
username if it first attempts the operation without one and is told by
Apache, "Sorry -- I need authn creds."

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2363644