Saturday, February 6, 2010

Subversion userid case-sensitivie validation for Active Directory

Subversion's user authentication is case sensitive for both userid and password.  While this is the standard in the *nix world, unfortunately Windows users tend to put their userid in whatever case they feel like.  I couldn't find a configuration option for this in Subversion, also no luck from the net...  So I went into the source code and did a quick & dirty workaround since all our users are validating their accounts against Windows Active Directory which is case-insensitive for their userid.

replace strcmp with strcasecmp in the following two lines.  This is for Subverison 1.4.0.  Just search for strcmp in the same file for newer version.

./subversion/libsvn_repos/authz.c

line 156:       else if (strcasecmp(user, group_user) == 0)
line 189:       else if (strcasecmp(name, b->user) != 0)