Issue Details (XML | Word | Printable)

Key: HUDSON-5684
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: qlp
Reporter: qlp
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hudson

Excluded Users field with subversion is too restrictive (doesn't work with a windows integrated subversion setup)

Created: 18/Feb/10 03:41 AM   Updated: 03/Mar/10 08:46 AM   Resolved: 03/Mar/10 01:03 AM
Return to search
Component/s: subversion
Affects Version/s: None
Fix Version/s: current

File Attachments: 1. File fix_hudson-5684.diff (4 kB)

Environment: Subversion server with integrated windows authentication


 Description  « Hide

The current regular expression for validating 'excluded users' is too restrictive. We use a subversion server which stores the domain name and the username (e.g. MYDOMAIN\myusername) as user. The current pattern \w+ only allows 'word characters'.

Please extend this pattern with a backslash (and maybe other characters as well, like '-._').

I found the currently validation implementation in:

http://svn-mirror.glassfish.org/hudson/trunk/hudson/plugins/subversion/src/main/java/hudson/scm/SubversionSCM.java

SubversionSCM.java
private static final Pattern USERNAME_PATTERN = Pattern.compile("\\w+");

        /**
         * Validates the excludeUsers field
         */
        public FormValidation doCheckExcludedUsers(@QueryParameter String value) throws IOException, ServletException {
            for (String user : Util.fixNull(value).trim().split("[\\r\\n]+")) {
                user = user.trim();

                if ("".equals(user)) {
                    continue;
                }

                if (!USERNAME_PATTERN.matcher(user).matches()) {
                    return FormValidation.error("Invalid username: " + user);
                }
            }

            return FormValidation.ok();
        }


Sort Order: Ascending order - Click to sort in descending order
qlp added a comment - 25/Feb/10 04:04 AM - edited

Attached patch accepts windows domain\user formatted usernames on the excluded users list. Tried it on my mac, but will test it on a windows environment next monday.

(NOTE: This also changes the pom.xml The version on the trunk didn't work for me)


qlp added a comment - 02/Mar/10 01:12 AM

Tested the patch in a Windows environment and it works. Asked Kohsuke how to get this patch in subversion plugin.


scm_issue_link added a comment - 03/Mar/10 08:46 AM

Code changed in hudson
User: : kohsuke
Path:
trunk/hudson/plugins/subversion/pom.xml
trunk/hudson/plugins/subversion/src/main/java/hudson/scm/SubversionSCM.java
trunk/hudson/plugins/subversion/src/test/java/hudson/scm/SubversionSCMTest.java
http://hudson-ci.org/commit/28143
Log:
[FIXED HUDSON-5684] applied a patch from qlp.