]> Cypherpunks.ru repositories - gocheese.git/blobdiff - passwd.go
Skip commented lines in password file
[gocheese.git] / passwd.go
index b13a342c92835a25dfc67f968dc956dfb54ae3d1..852192f8b7ea898cb54d7ea3a4e912f884e13bc9 100644 (file)
--- a/passwd.go
+++ b/passwd.go
@@ -31,6 +31,9 @@ func refreshPasswd() {
        }
        passwordsNew := make(map[string]Auther)
        for i, credentials := range strings.Split(strings.TrimRight(string(passwd), "\n"), "\n") {
+               if len(credentials) == 0 || strings.HasPrefix(credentials, "#") {
+                       continue
+               }
                splitted := strings.Split(credentials, ":")
                if len(splitted) != 2 {
                        log.Fatalf("%s:%d: Wrong login:password format", *passwdPath, i)