From 24fdecf10788d40c7d60c4371f4299e0eddcf236 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 3 Feb 2024 12:08:23 +0000 Subject: [PATCH] ftp: fix mkdir with rsftp which is returning the wrong code On a successfull MKD, rsftp seems to return code 250 whereas we and the RFC expects 257. This patch makes rclone accept 250 here as well. See: https://forum.rclone.org/t/rclone-pop-up-an-i-o-error-when-creating-a-folder-in-a-mounted-ftp-drive/44368/3 --- backend/ftp/ftp.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/ftp/ftp.go b/backend/ftp/ftp.go index aab419779..6c7e7b105 100644 --- a/backend/ftp/ftp.go +++ b/backend/ftp/ftp.go @@ -970,6 +970,8 @@ func (f *Fs) mkdir(ctx context.Context, abspath string) error { f.putFtpConnection(&c, err) if errX := textprotoError(err); errX != nil { switch errX.Code { + case ftp.StatusRequestedFileActionOK: // some ftp servers apparently return 250 instead of 257 + err = nil // see: https://forum.rclone.org/t/rclone-pop-up-an-i-o-error-when-creating-a-folder-in-a-mounted-ftp-drive/44368/ case ftp.StatusFileUnavailable: // dir already exists: see issue #2181 err = nil case 521: // dir already exists: error number according to RFC 959: issue #2363