auth/rpc: Token can be concurrently edited protect it. (#3764)

Make sure we protect when we access `authToken` in authClient.

Fixes #3761
master
Harshavardhana 8 years ago committed by GitHub
parent 34d9a6b46a
commit 0137ff498a
  1. 2
      cmd/auth-rpc-client.go

@ -115,8 +115,10 @@ func (authClient *AuthRPCClient) call(serviceMethod string, args interface {
}, reply interface{}) (err error) {
// On successful login, execute RPC call.
if err = authClient.Login(); err == nil {
authClient.Lock()
// Set token and timestamp before the rpc call.
args.SetAuthToken(authClient.authToken)
authClient.Unlock()
args.SetRequestTime(time.Now().UTC())
// Do RPC call.

Loading…
Cancel
Save