mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
sftpd: improve logging if filesystem creation fails
This commit is contained in:
@@ -456,6 +456,8 @@ func (c *Configuration) AcceptInboundConnection(conn net.Conn, config *ssh.Serve
|
|||||||
channel: channel,
|
channel: channel,
|
||||||
}
|
}
|
||||||
go c.handleSftpConnection(channel, &connection)
|
go c.handleSftpConnection(channel, &connection)
|
||||||
|
} else {
|
||||||
|
logger.Debug(logSender, connID, "unable to create filesystem: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "exec":
|
case "exec":
|
||||||
@@ -469,6 +471,8 @@ func (c *Configuration) AcceptInboundConnection(conn net.Conn, config *ssh.Serve
|
|||||||
channel: channel,
|
channel: channel,
|
||||||
}
|
}
|
||||||
ok = processSSHCommand(req.Payload, &connection, c.EnabledSSHCommands)
|
ok = processSSHCommand(req.Payload, &connection, c.EnabledSSHCommands)
|
||||||
|
} else {
|
||||||
|
logger.Debug(sshCommandLogSender, connID, "unable to create filesystem: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if req.WantReply {
|
if req.WantReply {
|
||||||
|
|||||||
@@ -1070,12 +1070,19 @@ func TestSFTPFsLoginWrongFingerprint(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out, err := runSSHCommand("md5sum", sftpUser, usePubKey)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Contains(t, string(out), "d41d8cd98f00b204e9800998ecf8427e")
|
||||||
|
|
||||||
sftpUser.FsConfig.SFTPConfig.Fingerprints = []string{"wrong"}
|
sftpUser.FsConfig.SFTPConfig.Fingerprints = []string{"wrong"}
|
||||||
_, _, err = httpdtest.UpdateUser(sftpUser, http.StatusOK, "")
|
_, _, err = httpdtest.UpdateUser(sftpUser, http.StatusOK, "")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
_, err = getSftpClient(sftpUser, usePubKey)
|
_, err = getSftpClient(sftpUser, usePubKey)
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
|
|
||||||
|
_, err = runSSHCommand("md5sum", sftpUser, usePubKey)
|
||||||
|
assert.Error(t, err)
|
||||||
|
|
||||||
_, err = httpdtest.RemoveUser(sftpUser, http.StatusOK)
|
_, err = httpdtest.RemoveUser(sftpUser, http.StatusOK)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
_, err = httpdtest.RemoveUser(localUser, http.StatusOK)
|
_, err = httpdtest.RemoveUser(localUser, http.StatusOK)
|
||||||
|
|||||||
Reference in New Issue
Block a user