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

ws: conditional start of ssh-agent #21202

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion containers/ws/label-run
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ else

/usr/libexec/cockpit-certificate-ensure

if [ -z "$SSH_AUTH_SOCK" ]; then
if [ -z ${SSH_AUTH_SOCK+x} ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please write that in standard shell syntax and with quotes: [ -z "${SSH_AUTH_SOCK:-}" ]

eval "$(ssh-agent)"
else
echo Agent sock ${SSH_AUTH_SOCK}
Comment on lines +47 to +48
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debugging leftover, please drop.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I put that in on purpose, as the previous output was Agent pid N .
But sure, can remove.

Copy link
Member

@martinpitt martinpitt Nov 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant, it's not really useful, as the user explicitly specified the path -- there's no surprise? And that path is only valid inside the container.

fi
exec /usr/libexec/cockpit-ws --local-ssh "$@"
fi