X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=passwd.go;h=7664dc5776ab1e795e457893f17b35cd28fbe300;hb=cde8c8c45d508bf29d24365298f3c40c1729514c;hp=1a32f70269b16f2d2de2b103b7b542025387144a;hpb=cc8232897ceab7f8dcfb7fce13de6ca75f1bdb74;p=gocheese.git diff --git a/passwd.go b/passwd.go index 1a32f70..7664dc5 100644 --- a/passwd.go +++ b/passwd.go @@ -1,7 +1,7 @@ /* GoCheese -- Python private package repository and caching proxy -Copyright (C) 2019-2021 Sergey Matveev - 2019-2021 Elena Balakhonova +Copyright (C) 2019-2022 Sergey Matveev + 2019-2022 Elena Balakhonova This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -91,3 +91,15 @@ func passwdReader(fd *os.File) bool { } return isGood } + +func passwdLister(fd *os.File) { + PasswordsM.RLock() + logins := make([]string, 0, len(Passwords)) + for login := range Passwords { + logins = append(logins, login) + } + PasswordsM.RUnlock() + for _, login := range logins { + fd.WriteString(login + "\n") + } +}