From cc5325d22ba1439e987fe7432bc3f8563f1305b8 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 13 Dec 2022 14:51:44 +0800 Subject: [PATCH 1/2] Fix: change error code in function isAccessDenied to AccessDenied Signed-off-by: Xun Jiang --- changelog/unreleased/issue-4085 | 1 + internal/backend/s3/s3.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/issue-4085 diff --git a/changelog/unreleased/issue-4085 b/changelog/unreleased/issue-4085 new file mode 100644 index 000000000..f8dba293a --- /dev/null +++ b/changelog/unreleased/issue-4085 @@ -0,0 +1 @@ +Fix error code in function isAccessDenied. \ No newline at end of file diff --git a/internal/backend/s3/s3.go b/internal/backend/s3/s3.go index 58ae65f97..ad652a206 100644 --- a/internal/backend/s3/s3.go +++ b/internal/backend/s3/s3.go @@ -164,7 +164,7 @@ func isAccessDenied(err error) bool { debug.Log("isAccessDenied(%T, %#v)", err, err) var e minio.ErrorResponse - return errors.As(err, &e) && e.Code == "Access Denied" + return errors.As(err, &e) && e.Code == "AccessDenied" } // IsNotExist returns true if the error is caused by a not existing file. From ecc62c8be24eb9c592b69da12b8f53bcbbeaea04 Mon Sep 17 00:00:00 2001 From: Xun Jiang/Bruce Jiang <59276555+blackpiglet@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:36:44 +0800 Subject: [PATCH 2/2] Update changelog/unreleased/issue-4085 Co-authored-by: greatroar <61184462+greatroar@users.noreply.github.com> Signed-off-by: Xun Jiang --- changelog/unreleased/issue-4085 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/changelog/unreleased/issue-4085 b/changelog/unreleased/issue-4085 index f8dba293a..7bf50dcbd 100644 --- a/changelog/unreleased/issue-4085 +++ b/changelog/unreleased/issue-4085 @@ -1 +1,8 @@ -Fix error code in function isAccessDenied. \ No newline at end of file +Bugfix: Restic init ignores "Access Denied" errors when creating an S3 bucket + +In restic 0.9.0 through 0.13.0, some permission errors from S3 backends where ignored +when trying to check the bucket existence, so that manually created buckets with custom permissions +could be used for backups. This feature was broken in 0.14.0, but is now restored. + +https://github.com/restic/restic/issues/4085 +https://github.com/restic/restic/pull/4086