[WebSVN] blame.php and usernames with whitespaces

View: New views
1 Messages — Rating Filter:   Alert me  

[WebSVN] blame.php and usernames with whitespaces

by Udo Rader :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

preface: we are currently overhauling our respository server. Among
other things we are changing authenication towards X.509 certificates
only. Due to this, the usernames used in commits will be the
certificates subjects, for example

/C=AT/ST=Austria/L=Innsbruck/O=The Foo Bar Company/OU=Testing
Dept./CN=Mr. Foo Bar/emailAddress=foo.bar@...

In general, WebSVN doesn't deal very nicely with such long usernames,
but we have already patched most of it to display only the email address
of the subjects as usernames. A patch will follow soon.

Yet, WebSVN's blame functionaly makes a bit more trouble.
Currently it invokes

svn blame $FILE > $TMPFILE
(include/svnlook.php@840)

and then retrieves the values to display using sscanf

list($revision, $author, $remainder) = sscanf($blameline, '%d %s %s');
(blame.php@105)

Now that causes problems if the username contains whitespaces like in
our certificate example, because sscanf does not behave nicely and
simply cuts off after the first whitespace. So in our example, the
username becomes "/C=AT/ST=Austria/L=Innsbruck/O=The"

The only clean I can think about is to use svn blame --xml $FILE and
then parse the xml file accordingly.

Any other ideas how to deal with this problem?

--
Udo Rader, CTO
http://www.bestsolution.at
http://riaschissl.blogspot.com

------------------------------------------------------
http://websvn.tigris.org/ds/viewMessage.do?dsForumId=1547&dsMessageId=2393651

To unsubscribe from this discussion, e-mail: [dev-unsubscribe@...].