Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Panic on password string #549

Closed
inferiorhumanorgans opened this issue Aug 21, 2016 · 2 comments
Closed

Panic on password string #549

inferiorhumanorgans opened this issue Aug 21, 2016 · 2 comments
Labels
Milestone

Comments

@inferiorhumanorgans
Copy link

http://docs.uchiwa.io/en/latest/configuration/uchiwa/

Following the instructions for encrypted passwords I added a users stanza to config.json like so:

    "users": [
      { 
        "username": "user",
        "password": "{crypt}SHA512HASH",
        "readonly": false
      }
    ]
$ git log -n 1 --oneline
f0df77b Fix coverprofile for authentication & authorization packages
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

While trying to log in, I get:

2016/08/21 23:06:49 http: panic serving 172.16.0.3:30133: runtime error: index out of range
goroutine 30 [running]:
net/http.(*conn).serve.func1(0xc8200ee280)
        /usr/local/go/src/net/http/server.go:1389 +0xc1
panic(0x7b54e0, 0xc82000a0b0)
        /usr/local/go/src/runtime/panic.go:443 +0x4e9
github.com/sensu/uchiwa/vendor/github.com/kless/osutil/user/crypt.NewFromHash(0xc820222180, 0x80, 0x0, 0x0)
        /home/alex/go/src/github.com/sensu/uchiwa/vendor/github.com/kless/osutil/user/crypt/crypt.go:100 +0x52a
github.com/sensu/uchiwa/uchiwa/authentication.simple(0xc8201ad5d4, 0x4, 0xc8201ad5f0, 0xc, 0xc8201949c0, 0x0, 0x0)
        /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/authentication/drivers.go:55 +0x24c
github.com/sensu/uchiwa/uchiwa/authentication.(*Config).login(0xc8204449b0, 0xc8201ad5d4, 0x4, 0xc8201ad5f0, 0xc, 0x4cf7ed, 0x0, 0x0)
        /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/authentication/services.go:7 +0x75
github.com/sensu/uchiwa/uchiwa/authentication.(*Config).Login.func1(0x800ad4260, 0xc82021c0d0, 0xc8201387e0)
        /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/authentication/controllers.go:94 +0x603
net/http.HandlerFunc.ServeHTTP(0xc82000bcd0, 0x800ad4260, 0xc82021c0d0, 0xc8201387e0)
        /usr/local/go/src/net/http/server.go:1618 +0x3a
net/http.(*ServeMux).ServeHTTP(0xc820010ba0, 0x800ad4260, 0xc82021c0d0, 0xc8201387e0)
        /usr/local/go/src/net/http/server.go:1910 +0x17d
net/http.serverHandler.ServeHTTP(0xc820436500, 0x800ad4260, 0xc82021c0d0, 0xc8201387e0)
        /usr/local/go/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc8200ee280)
        /usr/local/go/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:2137 +0x44e
@inferiorhumanorgans
Copy link
Author

Upon further investigation this is because the hash is not prefixed with the voodoo magic it needs.

@palourde palourde added the Bug label Aug 24, 2016
@palourde
Copy link
Contributor

I'll have to figure out the cause of this panic, it should not happen obviously!

@palourde palourde added this to the 0.17.2 milestone Aug 24, 2016
@palourde palourde modified the milestones: 0.19.0, 0.18.0 Sep 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants