fix lint
This commit is contained in:
parent
8fbbc0d7c1
commit
57ce8cfdaa
4 changed files with 10 additions and 2 deletions
|
|
@ -125,6 +125,9 @@ func TestFindUpstream(t *testing.T) {
|
|||
h := p.GetHandler()
|
||||
|
||||
listener, err := createListener(t)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer listener.Close()
|
||||
|
||||
createEntry(t, db, "finddown0", "findup0", listener.Addr().String(), false)
|
||||
|
|
@ -164,6 +167,9 @@ func TestPublicKeyCallback(t *testing.T) {
|
|||
h := p.GetHandler()
|
||||
|
||||
listener, err := createListener(t)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer listener.Close()
|
||||
|
||||
pub, _ := createEntry(t, db, "pkdown", "pkdown", listener.Addr().String(), false)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"net/url"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
_ "github.com/jinzhu/gorm/dialects/mssql"
|
||||
_ "github.com/jinzhu/gorm/dialects/mssql" // gorm dialect
|
||||
|
||||
upstreamprovider "github.com/tg123/sshpiper/sshpiperd/upstream"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ func (p *plugin) ListPipe() ([]upstream.Pipe, error) {
|
|||
}
|
||||
|
||||
host, port, mappedUser, err := parseUpstreamFile(string(data))
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
pipes = append(pipes, upstream.Pipe{
|
||||
Host: host,
|
||||
|
|
|
|||
|
|
@ -122,7 +122,6 @@ func findUpstreamFromUserfile(conn ssh.ConnMetadata, challengeContext ssh.Additi
|
|||
err := userUpstreamFile.checkPerm(user)
|
||||
|
||||
if os.IsNotExist(err) && len(config.FallbackUsername) > 0 {
|
||||
err = nil
|
||||
user = config.FallbackUsername
|
||||
} else if err != nil {
|
||||
return nil, nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue