Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 205251 - CVS username disallows full kerberos names
Summary: CVS username disallows full kerberos names
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.8 M5   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 359477 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-02 19:21 EDT by Pat Moore CLA
Modified: 2011-12-16 08:36 EST (History)
4 users (show)

See Also:


Attachments
ConfigurationWizardMainPage.java (21.80 KB, patch)
2011-10-14 14:07 EDT, Keerthi Vasan CLA
no flags Details | Diff
CVSRepositoryLocation.java (46.54 KB, patch)
2011-10-14 14:14 EDT, Keerthi Vasan CLA
no flags Details | Diff
ScreenShots (88.50 KB, application/msword)
2011-10-14 23:33 EDT, Keerthi Vasan CLA
no flags Details
Failing test (1.11 KB, patch)
2011-10-20 07:46 EDT, Tomasz Zarna CLA
no flags Details | Diff
mylyn/context/zip (30.88 KB, application/octet-stream)
2011-10-20 07:46 EDT, Tomasz Zarna CLA
no flags Details
Patch for CVS user name to allow full kerberos names (5.53 KB, patch)
2011-11-21 18:16 EST, Keerthi Vasan CLA
tomasz.zarna: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pat Moore CLA 2007-10-02 19:21:02 EDT
Build ID: M20060921-0945

Steps To Reproduce:
1.Use New->Repository Location in CVS Repositories view
2. In User column, try to specify a fully qualified Kerberos username (e.g., bill@ATHENA.MIT.EDU)
3. The '@' character triggers an "Invalid User Name" error


More information:
A fix is needed in environments that allow SSH with kerberos-validated password login by users in trusted foreign realms. Tortoise, WinCVS, plain CVS all work fine. In Tortoise, the CVSROOT looks like this: CVSROOT=:ext:bill@realm.domain.gov@hostname.domain.gov:/var/local/cvs

If you allow a single '@' in a username, and just pass the fully qualified name on as the username, it should work fine.  In our case, we need it to work with extssh.
Comment 1 Szymon Brandys CLA 2007-10-03 05:31:52 EDT
In 3.3 this is still an issue.
Comment 2 Atsuhiko Yamanaka CLA 2007-11-01 04:01:59 EDT
(In reply to comment #0)
> If you allow a single '@' in a username, and just pass the fully qualified name
> on as the username, it should work fine.  In our case, we need it to work with
> extssh.

For extssh connection, jsch has been used internally.
The jsch has supported the authentication method "gssapi-with-mic" using
Kerberos5, but Eclipse SDK 3.3 can not enjoy it,
because 'plugins/com.jcraft.jsch_0.1.31.jar' has not included
'com.jcraft.jsch.jgss' package.

If you are allowed to login with the partial name,
update that jar file at 'http://eclipse.jcraft.com/site.xml' and try it.
If you don't want to use update manager, here is the link to the latest jar,
  http://eclipse.jcraft.com/plugins/com.jcraft.jsch_0.1.36.jar

Comment 3 Nikita Pchelin CLA 2010-08-05 10:26:27 EDT
Is there any status update on this bug? I am using 3.6 on XP and it still seems to be an issue
Comment 4 Tomasz Zarna CLA 2010-08-05 11:09:11 EDT
Except for what Atsuhiko suggested in comment 2, the bug is still open (ASSIGNED) and waiting for a volunteer to fix it.
Comment 5 Tomasz Zarna CLA 2011-10-11 08:51:39 EDT
*** Bug 359477 has been marked as a duplicate of this bug. ***
Comment 6 Keerthi Vasan CLA 2011-10-14 14:05:02 EDT
Tomasz,

    As requested I'm submitting the patch for User field to accept fully qualified Kerberos username (e.g., john.smith@usa.win.int.kn)

    The changes are made to the following two files:- 

1. ConfigurationWizardMainPage.java (org\eclipse\team\internal\ccvs\ui\wizards)
   source downloaded from 
   org.eclipse.team.cvs.ui.source_3.3.301.R36x_v20100825-0800.jar


2. CVSRepositoryLocation.java (org\eclipse\team\internal\ccvs\core\connection)
   source downloaded from 
   org.eclipse.team.cvs.core.source_3.3.300.I20100526-0800.jar


Please let me know if you need additional information.

Thanks 
Keerthi.
Comment 7 Keerthi Vasan CLA 2011-10-14 14:07:55 EDT
Created attachment 205226 [details]
ConfigurationWizardMainPage.java

The ConfigurationWizardMainPage.java has been modified not to check the @ sign for user name:

The following if statment of the validateUserName method has been modified


        if ((user.indexOf('@') != -1) || (user.indexOf(':') != -1)) {
            return new Status(IStatus.ERROR, CVSUIPlugin.ID,
INVALID_FIELD_CONTENTS,
                    CVSUIMessages.ConfigurationWizardMainPage_invalidUserName,
null);
        }


to this (removed the check (user.indexOf('@') != -1) 

    if (user.indexOf(':') != -1) {
            return new Status(IStatus.ERROR, CVSUIPlugin.ID,
INVALID_FIELD_CONTENTS,
                    CVSUIMessages.ConfigurationWizardMainPage_invalidUserName,
null);
        }
Comment 8 Keerthi Vasan CLA 2011-10-14 14:14:39 EDT
Created attachment 205228 [details]
CVSRepositoryLocation.java

The following code of CVSRepositoryLocation.java in fromString(String lcoation, boolean validateOnly) method has been modified 

from:
end = location.lastIndexOf(HOST_SEPARATOR, location.length());

to:
end = location.lastIndexOf(HOST_SEPARATOR, location.length());
Comment 9 Keerthi Vasan CLA 2011-10-14 14:56:05 EDT
There is a minor correction in my previous comment.

The following code of CVSRepositoryLocation.java in fromString(String lcoation,
boolean validateOnly) method has been modified 

from:

end = location.indexOf(HOST_SEPARATOR, start);

to:

end = location.lastIndexOf(HOST_SEPARATOR, location.length());
Comment 10 Keerthi Vasan CLA 2011-10-14 23:33:00 EDT
Created attachment 205242 [details]
ScreenShots
Comment 11 Tomasz Zarna CLA 2011-10-20 07:46:38 EDT
Created attachment 205610 [details]
Failing test

Keerthi, what you suggested looks reasonable but it requires more work:
1. I wrote a simple test that showed your change would break CVSRepositoryLocation.getLocation(), see the attachment. This need to be fixed.
2. Please create a real patch by cloning git://git.eclipse.org/gitroot/platform/eclipse.platform.team.git. Apply your changes and generate a diff then. No need to send .java files.
3. Make sure you're creating a patch against the newest code base so you don't revert changes that have been already made in the repo. You did that in one of the .java files you submitted because you used an older code base (comment 6).
Comment 12 Tomasz Zarna CLA 2011-10-20 07:46:43 EDT
Created attachment 205611 [details]
mylyn/context/zip
Comment 13 Keerthi Vasan CLA 2011-11-21 18:16:22 EST
Created attachment 207340 [details]
Patch for CVS user name to allow full kerberos names

Tomasz,
Please find the attached patch - Fix for CVS user name to allow full kerberos names
Comment 14 Tomasz Zarna CLA 2011-12-16 08:36:50 EST
Fixed with 4d359c6f870e5c11891c413250a93caaaec7f1e6. Available in builds >=N20111216-2000. Thanks for the patch!