September 2009


Subversion23 Sep 2009 06:48 pm

The CollabNet binaries for Subversion generally provide a simple means for setting up Subversion on a Windows box. The build includes Apache and the installer will get you up and running rather quickly. In the years since I’ve started using Subversion, I’ve always used Apache and therefore http as the svn protocol. Recently, I decided to avoid the extra steps involved with setting up Apache and SVN and opted instead for running the svnserve.exe as a Windows service. I’ve run into a few gotchas that I think are worth noting.

Subversion’s basic security simply stores plain text passwords. If you’re looking for a better means to protect user information, you need to use SASL. SASL allows you to create a binary users file, without plaintext passwords. SASL uses a config file, svn.conf that you store in a known path (where the SASL binaries live).

I first got svnserve.exe up and running by running it from the command line:

svnserve.exe -d -r c:pathtorepos

Everything was working fine. So I decided to install svnserve as a Windows service. The strange thing is the CollabNet installer prompts to install the service into SCM. But even when checked, it didn’t. I tried to run the installer again to fix, upgrading from 1.4 to 1.5. The 1.5 installer changed the install path from C:\Program Files\CollabNet Subversion Server to C:\Program Files\CollabNet\Subversion Server (note the extra slash). I failed to notice this change and had parallel installations.

I googled around and found that svnserve.exe actually needs to be installed with sc (unclear on the MSI’s checkbox). So I ran:

sc create svnserve binPath="C:Program Files..."

After some hair pulling and hand wringing, I realized that the options for sc require a space after the equals sign. There’s a vague help entry about it when you run sc, but it’s odd and subtle and will drive you crazy. The space in the Program Files path also requires some escaped quotes:

binPath="\"C:Program FilesCollabNet Subversion Serversvnserve.exe\" --service -r: c:repos"

Once I finally got the service installed, I was getting errors trying to start the service. I had inadvertently continued to use the old installed path “CollabNet Subversion Server” vs. “CollabNet\Subversion Server.” After I got the service running against the correct path, I started to get SASL errors.

I kept getting invalid user not found errors, though I clearly had a password file that was valid. There’s a SASL utility for checking the user list in the files. As an experiment, I stopped the service and ran the command line. It worked. I checked my SASL conf file.

pwcheck_method: auxprop
auxprop_plugin: sasldb
sasldb_path: passwordsdb.txt
mech_list: DIGEST-MD5

It then occurred to me, that when svnserve.exe is running as a service, it wasn’t resolving sasldb_path to the correct path. I find this behavior odd, because I ran the command line from my users directory and not the CollabNet\Subversion Server directory. After that, everything was working as expected.

IronPython & CodeVoyeur & DLR10 Sep 2009 07:16 pm

Subversion09 Sep 2009 06:56 pm