mirror of
https://github.com/restic/rest-server.git
synced 2025-12-06 17:15:45 -08:00
Unexport users map in htpasswd struct
This commit is contained in:
committed by
Leo R. Lundgren
parent
6bc87b8e95
commit
b0036d006b
@@ -50,7 +50,7 @@ type HtpasswdFile struct {
|
||||
path string
|
||||
stat os.FileInfo
|
||||
throttle chan struct{}
|
||||
Users map[string]string
|
||||
users map[string]string
|
||||
}
|
||||
|
||||
// NewHtpasswdFromFile reads the users and passwords from a htpasswd file and returns them. If an error is encountered,
|
||||
@@ -130,7 +130,7 @@ func (h *HtpasswdFile) Reload() error {
|
||||
|
||||
// Replace the Users map
|
||||
h.mutex.Lock()
|
||||
h.Users = users
|
||||
h.users = users
|
||||
h.mutex.Unlock()
|
||||
|
||||
_ = r.Close()
|
||||
@@ -178,7 +178,7 @@ func (h *HtpasswdFile) Validate(user string, password string) bool {
|
||||
_ = h.ReloadCheck()
|
||||
|
||||
h.mutex.Lock()
|
||||
realPassword, exists := h.Users[user]
|
||||
realPassword, exists := h.users[user]
|
||||
h.mutex.Unlock()
|
||||
|
||||
if !exists {
|
||||
|
||||
Reference in New Issue
Block a user