fix file tranfser access control.
This commit is contained in:
parent
db87229f16
commit
04a0ce17de
@ -8,6 +8,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (h *MessageHandler) FileTransferRefresh(session types.Session) error {
|
func (h *MessageHandler) FileTransferRefresh(session types.Session) error {
|
||||||
|
if !h.state.FileTransferEnabled() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
fileTransferPath := h.state.FileTransferPath("") // root
|
fileTransferPath := h.state.FileTransferPath("") // root
|
||||||
|
|
||||||
// allow users only if file transfer is not locked
|
// allow users only if file transfer is not locked
|
||||||
@ -16,6 +20,7 @@ func (h *MessageHandler) FileTransferRefresh(session types.Session) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: keep list of files in memory and update it on file changes
|
||||||
files, err := utils.ListFiles(fileTransferPath)
|
files, err := utils.ListFiles(fileTransferPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Reference in New Issue
Block a user