Skip to content

Commit

Permalink
Merge pull request #309 from godbus/fix/auth_ok_missing_uid
Browse files Browse the repository at this point in the history
auth: handle improperly formatted OK correctly
  • Loading branch information
guelfey authored Feb 13, 2022
2 parents 041560b + 301a69e commit 32cb891
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ func (conn *Conn) tryAuth(m Auth, state authState, in *bufio.Reader) (error, boo
return err, false
}
state = waitingForReject
} else {
conn.uuid = string(s[1])
return nil, true
}
conn.uuid = string(s[1])
return nil, true
case state == waitingForData:
err = authWriteLine(conn.transport, []byte("ERROR"))
if err != nil {
Expand All @@ -191,9 +192,10 @@ func (conn *Conn) tryAuth(m Auth, state authState, in *bufio.Reader) (error, boo
return err, false
}
state = waitingForReject
} else {
conn.uuid = string(s[1])
return nil, true
}
conn.uuid = string(s[1])
return nil, true
case state == waitingForOk && string(s[0]) == "DATA":
err = authWriteLine(conn.transport, []byte("DATA"))
if err != nil {
Expand Down

0 comments on commit 32cb891

Please sign in to comment.