Merge pull request #4086 from blackpiglet/modify_access_denied_code

Fix: change error code in function isAccessDenied to AccessDenied
This commit is contained in:
Michael Eischer 2022-12-16 21:55:52 +01:00 committed by GitHub
commit cccc17e4e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,8 @@
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

View File

@ -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.