up
This commit is contained in:
parent
3f378991d1
commit
5134f9aa28
11
main.go
11
main.go
@ -64,6 +64,17 @@ func (d *mainDriver) AuthUser(cc ftpserver.ClientContext, user, pass string) (ft
|
||||
fs: afero.NewBasePathFs(afero.NewOsFs(), uploadPath),
|
||||
}, nil
|
||||
}
|
||||
if user == "anonymous" && host == "82.65.73.115" {
|
||||
base := filepath.Clean("upload")
|
||||
fs := afero.NewBasePathFs(afero.NewOsFs(), base)
|
||||
log.Printf("[FTP] Login ANONYMOUS autorisé pour %s", host)
|
||||
return &ftpClientDriver{fs: fs}, nil
|
||||
}
|
||||
|
||||
// 3. Sinon refuse tout anonyme ou mauvais login
|
||||
if user == "" || user == "anonymous" {
|
||||
log.Printf("[FTP] Login anonymous refusé pour %s", host)
|
||||
|
||||
return nil, errors.New("identifiants invalides")
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user