You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Matt Joiner <an...@gmail.com> on 2011/10/05 08:45:32 UTC

Transaction author without requiring password

Hi Users,

I'm trying to force commits to have an attached author, but I don't
care for requiring passwords. In other words, commits should contain
an author field but there's no enforcing that the committer is who
they claim to be.

I've tried filtering for an author in the pre-commit hook, but the
user name given in the commit is not passed unless anon-access doesn't
given write privileges, and auth-access is enabled. Furthermore,
without a corresponding author name in the passwd file, I don't think
svnserve makes it to the pre-commit stage at all.

Are there any recommended solutions for ensuring that commits have an
attached author, or similar field?

Cheers,
Matt

RE: Transaction author without requiring password

Posted by Dominik Psenner <dp...@gmail.com>.
>I tried this, but an author is not passed unless auth-access is in use
>AFAICT. So $USER in your example is always empty.

This would mean that you would never see any usernames in commits. Did you
try to commit using the --username parameter?


RE: Transaction author without requiring password

Posted by Dominik Psenner <dp...@gmail.com>.
>Yes I did, and this is my deduction also. The user names won't make it
>to the pre-commit unless they're required to authenticate by svnserve
>first.

I'm not an svnserve expert, please don't expect help there. All I can say
is, that you could try to set up subversion within apache. Then it should
work since we're using it daily.


Re: Transaction author without requiring password

Posted by Matt Joiner <an...@gmail.com>.
Yes I did, and this is my deduction also. The user names won't make it
to the pre-commit unless they're required to authenticate by svnserve
first.

On Wed, Oct 5, 2011 at 10:31 PM, Dominik Psenner <dp...@gmail.com> wrote:
>>I tried this, but an author is not passed unless auth-access is in use
>>AFAICT. So $USER in your example is always empty.
>
> This would mean that you would never see any usernames in commits. Did you
> try to commit using the --username parameter?
>
>

Re: Transaction author without requiring password

Posted by Matt Joiner <an...@gmail.com>.
I tried this, but an author is not passed unless auth-access is in use
AFAICT. So $USER in your example is always empty.

On Wed, Oct 5, 2011 at 7:16 PM, Dominik Psenner <dp...@gmail.com> wrote:
>>I'm trying to force commits to have an attached author, but I don't
>>care for requiring passwords. In other words, commits should contain
>>an author field but there's no enforcing that the committer is who
>>they claim to be.
>>
>>I've tried filtering for an author in the pre-commit hook, but the
>>user name given in the commit is not passed unless anon-access doesn't
>>given write privileges, and auth-access is enabled. Furthermore,
>>without a corresponding author name in the passwd file, I don't think
>>svnserve makes it to the pre-commit stage at all.
>>
>>Are there any recommended solutions for ensuring that commits have an
>>attached author, or similar field?
>
> Maybe something like this put in place as a pre-commit hook?
>
> #!/bin/bash
> SVNLOOK=/usr/bin/svnlook
> REPOPATH=$1
> TRANSACTION=$2
>
> # get user
> USER=`$SVNLOOK author $REPOPATH -t $TRANSACTION`
>
> # check if the user is empty
> if[ -z "$USER" ]; then
>  exit 1
> exit 0
>
>

RE: Transaction author without requiring password

Posted by Dominik Psenner <dp...@gmail.com>.
>I'm trying to force commits to have an attached author, but I don't
>care for requiring passwords. In other words, commits should contain
>an author field but there's no enforcing that the committer is who
>they claim to be.
>
>I've tried filtering for an author in the pre-commit hook, but the
>user name given in the commit is not passed unless anon-access doesn't
>given write privileges, and auth-access is enabled. Furthermore,
>without a corresponding author name in the passwd file, I don't think
>svnserve makes it to the pre-commit stage at all.
>
>Are there any recommended solutions for ensuring that commits have an
>attached author, or similar field?

Maybe something like this put in place as a pre-commit hook?

#!/bin/bash
SVNLOOK=/usr/bin/svnlook
REPOPATH=$1
TRANSACTION=$2

# get user
USER=`$SVNLOOK author $REPOPATH -t $TRANSACTION`

# check if the user is empty
if[ -z "$USER" ]; then
  exit 1
exit 0