This commit is contained in:
cangui 2025-07-27 21:41:53 +02:00
parent 3f378991d1
commit 5134f9aa28

11
main.go
View File

@ -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")
}