Bug 395851 - NPE when authenticating at Hudson server via NTLM
Summary: NPE when authenticating at Hudson server via NTLM
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 3.8.3   Edit
Assignee: Christian Janz CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2012-12-05 14:19 EST by Christian Janz CLA
Modified: 2012-12-10 04:52 EST (History)
2 users (show)

See Also:


Attachments
Changing the value for "workstation" to empty string fixes the problem (972 bytes, application/octet-stream)
2012-12-05 14:19 EST, Christian Janz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Janz CLA 2012-12-05 14:19:20 EST
Created attachment 224328 [details]
Changing the value for "workstation" to empty string fixes the problem

While validating the connection to a Hudson server that is configured to authenticate via NTLM, a NPE is thrown.

Environment: Our Hudson/Jenkins server is located behind a reverse-proxy that enforces authentication via NTLM.

Steps to reproduce the problem:

1. "Add Build Server..." in Builds View
2. Choose "Hudson"
3. Fill in correct server URL and label
4. Leave "Anonymous" checked
5. In Section "HTTP authentication" check "Enable HTTP authentication"
5a. Fill in a username like 'mydomain\foo'
5b. Fill in password
6. Press "Validate"

Expected behavior: Validation succeeds

Actual Behavior: NullPointerException

java.lang.reflect.InvocationTargetException
	at org.eclipse.mylyn.commons.repositories.ui.RepositoryLocationPart$2.run(RepositoryLocationPart.java:563)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.lang.NullPointerException
	at org.apache.http.impl.auth.NTLMEngineImpl.stripDotSuffix(NTLMEngineImpl.java:175)
	at org.apache.http.impl.auth.NTLMEngineImpl.convertHost(NTLMEngineImpl.java:183)
	at org.apache.http.impl.auth.NTLMEngineImpl.access$400(NTLMEngineImpl.java:45)
	at org.apache.http.impl.auth.NTLMEngineImpl$Type1Message.<init>(NTLMEngineImpl.java:764)
	at org.apache.http.impl.auth.NTLMEngineImpl.getType1Message(NTLMEngineImpl.java:128)
	at org.apache.http.impl.auth.NTLMEngineImpl.generateType1Msg(NTLMEngineImpl.java:1298)
	at org.apache.http.impl.auth.NTLMScheme.authenticate(NTLMScheme.java:125)
	at org.apache.http.impl.auth.AuthSchemeBase.authenticate(AuthSchemeBase.java:124)
	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:105)
	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:174)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:462)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.eclipse.mylyn.commons.repositories.http.core.HttpUtil$1.execute(HttpUtil.java:178)
	at org.eclipse.mylyn.commons.repositories.http.core.HttpUtil$1.execute(HttpUtil.java:1)
	at org.eclipse.mylyn.commons.core.operations.MonitoredOperation.call(MonitoredOperation.java:82)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)

The attached patch fixes the problem for me.
Comment 1 Steffen Pingel CLA 2012-12-06 14:02:21 EST
Thanks a lot for the patch! Would you be able to push that as a Gerrit review (see http://wiki.eclipse.org/Mylyn/Contributor_Reference#Reviews)?

Shawn, I think we discussed null vs. empty string at the time. Are you okay with the proposed change?
Comment 2 Christian Janz CLA 2012-12-08 15:19:46 EST
Hi Steffen,

thank you for the feedback.
I pushed the patch as a review to gerrit: https://git.eclipse.org/r/#/c/9123/
Comment 3 Steffen Pingel CLA 2012-12-10 04:52:57 EST
The fix was merged into master and the 3.8.x branch. Thanks for the contribution!