Skip to content

Commit

Permalink
Fix context shadowing during radius login (#4941)
Browse files Browse the repository at this point in the history
Fixes #4938
  • Loading branch information
jefferai authored and briankassouf committed Jul 17, 2018
1 parent e6bdfa2 commit 22658a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin/credential/radius/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ func (b *backend) RadiusLogin(ctx context.Context, req *logical.Request, usernam
Timeout: time.Duration(cfg.DialTimeout) * time.Second,
},
}
ctx, cancelFunc := context.WithTimeout(context.Background(), time.Duration(cfg.ReadTimeout)*time.Second)
received, err := client.Exchange(ctx, packet, hostport)
clientCtx, cancelFunc := context.WithTimeout(ctx, time.Duration(cfg.ReadTimeout)*time.Second)
received, err := client.Exchange(clientCtx, packet, hostport)
cancelFunc()
if err != nil {
return nil, logical.ErrorResponse(err.Error()), nil
Expand Down

0 comments on commit 22658a7

Please sign in to comment.