How can I programatically add a user to subversion from a shell script?
I would like to create a subversion user without restarting the subversion server but the only way to do this seems to be to edit the开发者_StackOverflow中文版 passwd file.
Is there a command to add a user?
There are different ways to authenticate depending on how svn is accessed. If you're serving it through apache htpasswd or htdigest may do what you want.
If you are using the svnserve daemon only, then the user file is the file named in
password-db = passwd.conf
in the conf/svnserve.conf
configuration file under the [general]
header.
There is no API to add users to this file but you can always do:
echo "$user = $passwd" >> conf/passwd.conf
Which will simply append the new user at the end of the list (I assume you have the [users]
header already set at the top of that file.
I don't think you should restart the server for the new user to be taken into account.
精彩评论