Skip to content

Commit

Permalink
[FIXED JENKINS-15994] get ticket parsing during login to work when th…
Browse files Browse the repository at this point in the history
…ere is custom authentication trigger output
  • Loading branch information
Rob Petti committed Jan 2, 2013
1 parent 08b9fc5 commit 7c74780
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -608,15 +608,13 @@ private String p4Login(String p4Exe) throws IOException, PerforceException {
String ticket = null;
BufferedReader reader = login.getReader();
String line;
int lineCounter = 1;
// The second line output from p4 login will be the ticket
// The line matching ^[0-9A-F]{32}$ will be the ticket
while ((line = reader.readLine()) != null) {
int error = checkAuthnErrors(line);
if (error != -1)
throw new PerforceException("Login attempt failed: " + line);
if (lineCounter == 2)
if (line.trim().matches("^[0-9A-F]{32}$"))
ticket = line;
lineCounter++;
}

return ticket;
Expand Down

0 comments on commit 7c74780

Please sign in to comment.