Skip to content

Commit

Permalink
[FIXED JENKINS-15862] take ticket from second line of 'p4 login' output
Browse files Browse the repository at this point in the history
  • Loading branch information
rpetti committed Nov 20, 2012
1 parent 840c94c commit 707d9d2
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -608,12 +608,15 @@ private String p4Login(String p4Exe) throws IOException, PerforceException {
String ticket = null;
BufferedReader reader = login.getReader();
String line;
// The last line output from p4 login will be the ticket
int lineCounter = 1;
// The second line output from p4 login will be the ticket
while ((line = reader.readLine()) != null) {
int error = checkAuthnErrors(line);
if (error != -1)
throw new PerforceException("Login attempt failed: " + line);
ticket = line;
if (lineCounter == 2)
ticket = line;
lineCounter++;
}

return ticket;
Expand Down

0 comments on commit 707d9d2

Please sign in to comment.