forked from TrueCloudLab/restic
Merge pull request #4086 from blackpiglet/modify_access_denied_code
Fix: change error code in function isAccessDenied to AccessDenied
This commit is contained in:
commit
cccc17e4e9
2 changed files with 9 additions and 1 deletions
8
changelog/unreleased/issue-4085
Normal file
8
changelog/unreleased/issue-4085
Normal 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
|
|
@ -164,7 +164,7 @@ func isAccessDenied(err error) bool {
|
||||||
debug.Log("isAccessDenied(%T, %#v)", err, err)
|
debug.Log("isAccessDenied(%T, %#v)", err, err)
|
||||||
|
|
||||||
var e minio.ErrorResponse
|
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.
|
// IsNotExist returns true if the error is caused by a not existing file.
|
||||||
|
|
Loading…
Reference in a new issue