Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support 403 in get_policy call #894

Closed
gemal opened this issue Jul 11, 2017 · 1 comment
Closed

support 403 in get_policy call #894

gemal opened this issue Jul 11, 2017 · 1 comment

Comments

@gemal
Copy link

gemal commented Jul 11, 2017

the info_cmd code has:

            try:
                policy = s3.get_policy(uri)
                output(u"   policy:    %s" % policy)
            except S3Error as exc:
                # Ignore the exception and don't fail the info
                # if the server doesn't support setting ACLs
                if exc.status not in [404, 501]:
                    raise exc
                output(u"   policy:    none")

if I try to run it on a bucket:

[shell]# s3cmd info s3://xxxx/mysql_backup/day/backup.07.11.2017.tar.gz
s3://xxxx/mysql_backup/day/backup.07.11.2017.tar.gz (object):
   File size: 257583
   Last mod:  Tue, 11 Jul 2017 03:00:05 GMT
   MIME type: application/x-gzip
   Storage:   STANDARD
   MD5 sum:   603ee6e281fca59a77dce1a82abe5e22
   SSE:       none
ERROR: Access to bucket 'xxxx' was denied
ERROR: S3 error: 403 (AccessDenied): Access Denied

perhaps the code should also check for 403 in the ignore?

@fviard
Copy link
Contributor

fviard commented Jul 11, 2017

Fixed in master, thank you for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants