mirror of
https://github.com/minio/minio.git
synced 2025-11-20 09:56:07 -05:00
config: Avoid stale credentials in memory. (#4466)
This commit is contained in:
@@ -405,10 +405,13 @@ func (web *webAPIHandlers) SetAuth(r *http.Request, args *SetAuthArgs, reply *Se
|
||||
errsMap := updateCredsOnPeers(creds)
|
||||
|
||||
// Update local credentials
|
||||
serverConfig.SetCredential(creds)
|
||||
prevCred := serverConfig.SetCredential(creds)
|
||||
|
||||
// Persist updated credentials.
|
||||
if err = serverConfig.Save(); err != nil {
|
||||
// Save the current creds when failed to update.
|
||||
serverConfig.SetCredential(prevCred)
|
||||
|
||||
errsMap[globalMinioAddr] = err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user