Repository navigation
core/service: set up credentials for all start-post commands too - #31197
Merged
Merged
Conversation
yuwata
requested changes
Feb 4, 2024
yuwata
left a comment
Member
There was a problem hiding this comment.
I think, we should introduce, something like the following.
static ExecFlags service_exec_flags(ServiceState state, ServiceExecCommand command_id) {
...
}Otherwise, we can easily introduce similar bug in the future.
Member
Author
|
I'll introduce a helper like that. But I think ExecCondition= and -Reload= by design should not be accessing credentials. |
YHNdnzj
marked this pull request as draft
February 4, 2024 10:02
YHNdnzj
force-pushed
the
protect-system-cred
branch
from
February 4, 2024 11:44
f80ca1a to
f06c5cd
Compare
YHNdnzj
force-pushed
the
protect-system-cred
branch
2 times, most recently
from
February 4, 2024 11:52
7ec4148 to
e6c6249
Compare
YHNdnzj
marked this pull request as ready for review
February 4, 2024 12:06
yuwata
requested changes
Feb 4, 2024
YHNdnzj
added a commit
to YHNdnzj/systemd
that referenced
this pull request
Feb 4, 2024
As suggested in systemd#31197 (review) Note that this slightly changes the behavior for ExecCondition= and ExecStartPost=. Will be corrected later.
YHNdnzj
force-pushed
the
protect-system-cred
branch
2 times, most recently
from
February 4, 2024 16:42
11d0738 to
9df4f91
Compare
As suggested in systemd#31197 (review) Note that this slightly changes the behavior for ExecReload=, ExecCondition= and ExecStartPost=. Will be explained/corrected in later commits.
yuwata
approved these changes
Feb 4, 2024
All tasks spawned later than ExecStart= (e.g. ExecReload=, ExecStop=, ...) don't get tty access. ExecStopPost= is the odd one out. Fix that.
This seems to be a mistake in systemd#27279. I believe credentials should not be made available to condition or reload tasks. In most cases they're irrelevant from the actual job of the service. Also, currently the first ExecCondition= or ExecReload= cannot access creds anyway, making the incompatibility introduced negligible. If people actually come up with valid use cases, we can always revisit this.
YHNdnzj
force-pushed
the
protect-system-cred
branch
from
February 4, 2024 16:59
9df4f91 to
39f4504
Compare
Member
Author
|
(Pushed to update commit messages) |
This was referenced Feb 12, 2024
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #31194