diff --git a/main.go b/main.go index 1ac53bc..89533b5 100644 --- a/main.go +++ b/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") }