Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

~/.subversion/auth/svn.simple/<hash> algorithm?

What is the algorithm for determining the file name in ~/.subversion/auth/svn.simple/ directory?

I am trying to setup subversion to authenticate non-interactively and to have it use an a priori created file for authentication (as opposed to having to authenticate manually for the first time). I cannot configure the server, only the client.

As an experiment, I manually authenticated to see what file is being created. It is trivial for me to create the file ahead of time, but I can't find an obvious way to generate the correct file name. For example:

cat <file> | md5

does not generate the file name :/. Similarly hashing the svn:realmstring or variations thereof fails to generate the correct file name.

In other words, given:

$ cat ~/.subversion/auth/svn.simple/a67f7e17e9b4059f367743be8f30c336

K 8
username
V 3
joe
K 8
password
V 4
blah
K 15
svn:realmstring
V 45
<https://svn.domain.com:443> Joe's repository
END

What do I need to hash in order to get a67f7e17e9b4059f367743be8f30c336?

like image 983
Tristan Avatar asked Jan 06 '14 14:01

Tristan


People also ask

What is SVN in subversion?

Subversion, with the command line tool svn, is a revision control system, also known as a source code management system (scm) or a source code control system (sccs). The subversion server maintains a repository, where files are stored in a hierarchy of folders, same as a traditional file system.

Where does subgit get the authentication data for subversion?

All the other access methods to a Subversion repository require the appropriate authentication settings for SubGit. SubGit obtains the authentication data from the [auth "default"] section of the SubGit configuration file that is located at GIT_REPO/subgit/config.

Where does subversion store usernames and passwords?

The Subversion authentication realm and usernames are stored in the ~/.subversion/auth/svn.simple directory. The encrypted passwords are stored in macOS Keychain. By default, Subversion clients ask permission to store unencrypted passwords in the ~/.subversion/auth/svn.simple directory.

How can I avoid retyping my Password when required by SVN?

A simple method to avoid retyping your password when required by svn, is to store your password in a file, at the root of your subversion repository and insert it into the command line using the unix back-tic (`) mechanism.


1 Answers

The answer is to md5 the svn:realmstring.

Given:

<https://svn.apache.org:443> ASF Committers

verify hash via (assuming that your MD5 utility is md5sum for example, on a Mac it is md5)

echo -n "<https://svn.apache.org:443> ASF Committers" | md5sum
> d3c8a345b14f6a1b42251aef8027ab57
like image 159
Tristan Avatar answered Sep 24 '22 02:09

Tristan