Skip to content

uninstall.sh: prints 'Deleted bucket' after a failed bucket delete #133

Open

Description

@royosherove

uninstall.sh L789-790:

aws s3 rb "s3://${b}" --force --region "$SCAN_REGION" 2>/dev/null || warn "Could not delete ${b}"
ok "Deleted bucket: ${b}"

Problem: ok always runs. If the delete fails (for example AccessDenied), the user sees "Could not delete X" and then "Deleted bucket: X" for the same bucket.

Fix:

if aws s3 rb "s3://${b}" --force --region "$SCAN_REGION" 2>/dev/null; then
  ok "Deleted bucket: ${b}"
else
  warn "Could not delete ${b}"
fi

Found by a code read at commit 1e50295. The code was read, but not run on a real instance.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions