-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix rootless socket activation #9928
Fix rootless socket activation #9928
Conversation
17e567a
to
286aa42
Compare
edd76c6
to
5b8f61c
Compare
@rhatdan modified according to your sugguestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the patch. Just left some comments
pkg/rootless/rootless_linux.c
Outdated
|
||
// save systemd socket environment for rootless child | ||
do_socket_activation = true; | ||
char * save_buf = (char *) calloc (len_pid + len_fds + len_fdnames, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a check for calloc
failures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also there is no need to use a single buffer here. Let's split it to multiple assignments and use strdup
instead. Each of the strdup
must be checked for errors.
So rootless setup could use this condition in parent and child, child podman should adjust LISTEN_PID to its self PID. Add system test for systemd socket activation Signed-off-by: pendulm <[email protected]>
5b8f61c
to
11917a1
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pendulm, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@baude @ashley-cui This might be the issue you were seeing in the podman-machine testing. |
LGTM |
/lgtm |
Oh - sorry. I thought @giuseppe added those as review comments on the PR, and since I didn't see any I assumed they'd been fixed. |
Fixed: #9484 |
Ok great. |
Move socket activation check into init() and set global condition, So rootless setup could use this condition in parent and child, child podman should adjust LISTEN_PID to its self PID.
This fix test for following scenarios:
when use Shortcut re-exec, I think the logic is still OK.
Closes: #9280
Signed-off-by: pendulm [email protected]