user104279
user104279

Reputation:

Why Subversion doesn't allow "." and "@" in usernames? Or does it?

We want to use the same user-id across all our dev tools, but this limitation from subversion is not allowing us to use email addresses as usernames.

Upvotes: 3

Views: 1698

Answers (6)

haxney
haxney

Reputation: 3438

Subversion actually uses UTF-8 internally to store all of its data, including the usernames, so there isn't really any restriction on what you can name your users. For example, I just created a commit with the user:

'Й, ק,‎ م, ๗, あ, 叶, 葉, and 말.'

The thing is, other programs may reserve certain characters for special purposes, such as [, =, and # in the svn passwd file. Subversion can handle a wider range of usernames, but that particular file format cannot. If you are finding yourself unable to use certain characters, it is a limitation of some other link in the chain, like Apache or your IDE or your database, or whatever.

That isn't too helpful because you probably can't easily fix whatever is causing this or switch tools, but such is the state of "weird" characters these days.

Upvotes: 1

bluebrother
bluebrother

Reputation: 8906

The usual way to construct URIs containing a username is protocol://user@host:port/path. svn uses this too, so the @ character is special. I haven't tried but I'm rather confident that you could escape it (like %40) to make it work. However, IMO it's a rather bad idea to use complete email addresses as usernames. If you're inside a company, why can't you use the local part? Everything else will most likely be the same for all users, thus you're only repeating information -- and it won't play nicely with log views.

See also RFC 3986.

Upvotes: 0

bendin
bendin

Reputation: 9574

At my $JOB company e-mail address is the standard user name for Subversion, so it must work.

On my team, however, we insisted on being given our (also company-wide) Windows user names which tend to be no longer than 8 characters. User names like [email protected] make for terrible usability in standard GUI log viewers and don't play nicely with svn blame.

Upvotes: 0

oyvindio
oyvindio

Reputation: 797

Well, since you can create groups consisting of multiple users, and later refer to them by using @<groupname>, I guess having a @ in a regular username may be a problem.

This is from the example in the default authz file generated when creating new svn repository:

[groups]
harry_and_sally = harry,sally
[repository:/baz/fuz]
@harry_and_sally = rw

Which gives the users in group harry_and_sally read and write permissions to the repository in /baz/fuz.

Upvotes: 2

Sander Marechal
Sander Marechal

Reputation: 23216

It really depends on how you set up Subversion. It's possible that the standard Subversion built-in authentication for svnserve does not allow . and @ (I haven't tried). I have set up my Subversion repositories using Apache instead of the built-in svnserve. Under Apache you can use standard Apache access controls like htpasswd files or even integration with LDAP or Microsoft Active Directory. Then you can use e-mail addresses or AD logins for your Subversion users.

Upvotes: 2

ismail
ismail

Reputation: 47672

It does allow "." in username, never tried @.

Upvotes: 0

Related Questions