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

eic_curl_authorized_keys returns incorrect exit code in some cases #40

Open
pagelypete opened this issue May 18, 2022 · 0 comments
Open

Comments

@pagelypete
Copy link

pagelypete commented May 18, 2022

In this section of the code curl is called with -f which causes it to return exit code 22 when the HTTP response code is >= 400. This means that when the user doesn't have any keys for example, and the metadata service returns 404, the script exits with code 22 due to the set -e in the script.

I discovered this when calling eic_run_authorized_keys as an additional fallback for my AuthorizedKeysCommand script, I was executing:

exec /usr/share/ec2-instance-connect/eic_run_authorized_keys "${@}"

Which would then cause my own script to return exit code 22, and thus no keys produced by the calling script were accepted at all either due to the non-zero code.

I am filing a bug because the logic in the script shows an intention for this to be an exit 0 scenario.

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

No branches or pull requests

1 participant