auth: nil check AuthInfo when checking admin permissions

If the context does not include auth information, get authinfo will
return a nil auth info and a nil error. This is then passed to
IsAdminPermitted, which would dereference the nil auth info.
This commit is contained in:
Anthony Romano
2017-03-10 11:07:11 -08:00
committed by Gyu-Ho Lee
parent a3c6f6bf81
commit 6ed56cd723

View File

@@ -764,6 +764,9 @@ func (as *authStore) IsAdminPermitted(authInfo *AuthInfo) error {
if !as.isAuthEnabled() {
return nil
}
if authInfo == nil {
return ErrUserEmpty
}
tx := as.be.BatchTx()
tx.Lock()