mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
allow to store temporary sessions within the data provider
so we can persist password reset codes, OIDC auth sessions and tokens. These features will also work in multi-node setups without sicky sessions now Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -73,7 +73,7 @@ func (c *SFTPFsConfig) isEqual(other *SFTPFsConfig) bool {
|
||||
return false
|
||||
}
|
||||
for _, fp := range c.Fingerprints {
|
||||
if !util.IsStringInSlice(fp, other.Fingerprints) {
|
||||
if !util.Contains(other.Fingerprints, fp) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -756,8 +756,8 @@ func (fs *SFTPFs) createConnection() error {
|
||||
User: fs.config.Username,
|
||||
HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error {
|
||||
fp := ssh.FingerprintSHA256(key)
|
||||
if util.IsStringInSlice(fp, sftpFingerprints) {
|
||||
if util.IsStringInSlice(fs.config.Username, fs.config.forbiddenSelfUsernames) {
|
||||
if util.Contains(sftpFingerprints, fp) {
|
||||
if util.Contains(fs.config.forbiddenSelfUsernames, fs.config.Username) {
|
||||
fsLog(fs, logger.LevelError, "SFTP loop or nested local SFTP folders detected, mount path %#v, username %#v, forbidden usernames: %+v",
|
||||
fs.mountPath, fs.config.Username, fs.config.forbiddenSelfUsernames)
|
||||
return ErrSFTPLoop
|
||||
|
||||
Reference in New Issue
Block a user