You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Xn Nooby <xn...@gmail.com> on 2006/06/01 14:23:59 UTC

Possible to have a default username for CLI and Tortoise? (but always prompt for PW)

I'm trying to figure out how to get Subversion and TortoiseSVN to default to
a specific username.  The username is actually the Windows signon, which the
command line Subversion commands seem to use.  TortoiseSVN never seems to
default to the Windows signon.  I have been playing with Subversion config
file options that control wehther or not to save the "password" and
"authentication" information, hoping to find the magic combination.

I have a build machine that normally would only be used for downloading (svn
up) the latest code, then building a final copy of our application.  I'm
trying to get the build machine to default to a username that has "read
only" access (I'm using the authz module and svnserve).  If a programmer
needs to make a change at the build machine, they need to be able to commit
under their own username (which will have write access to the repository).

Ideally, whenever someone used either Subversion or TortoiseSVN, the machine
would default to the read-only username and prompt them for that username's
password.  If they were trying to do a commit, they would change the default
name to their own and enter their own password.  I was hoping the Subversion
config file had an option to specify a default username, but I have not
found that.

Currently, TortoiseSVN seems to be an all-or-nothing thing.  If it is set to
not remember the password or auth, there is no default username at all.  If
it is set to remember, it no longer prompts the user.

Any suggestions?

Re: Possible to have a default username for CLI and Tortoise? (but always prompt for PW)

Posted by Dominic Anello <da...@danky.com>.
On 2006-06-01 10:23:59 -0400, Xn Nooby wrote:
----8<----
> Ideally, whenever someone used either Subversion or TortoiseSVN, the machine
> would default to the read-only username and prompt them for that username's
> password.  If they were trying to do a commit, they would change the default
> name to their own and enter their own password.  I was hoping the Subversion
> config file had an option to specify a default username, but I have not
> found that.

The svn command line client always caches the most recent authentication
information it has seen for a particular repository unless it has been
directed not to.  Your best bet is to do a checkout using your read-only
user and checkin using the username and no-auth-cache switches.

This is what we do in our build environment:
1. svn ls --username read_only_user --password ro_password http://server/repos
   
   This puts read_only_user's credentials into the auth cache.  You can
   now do all the checkouts and updates you want without the need to
   authenticate.

2. Then when you have to do a checkin for whatever reason you do:
   svn ci --username dev_user --no-auth-cache foo.c

   This prevents dev_user's credentials from overwriting
   read_only_user's.

Another alternative might be to make the files in
%APPDATA%\Subversion\auth\svn.simple read-only to prevent them being
updated with new auth credentials, but I've not tried that.

> Currently, TortoiseSVN seems to be an all-or-nothing thing.  If it is set to
> not remember the password or auth, there is no default username at all.  If
> it is set to remember, it no longer prompts the user.

I don't believe there is any comparable solution for Tortoise.

-Dominic