core/unit: sort the dropin paths of a unit#35711
Closed
wenjianhn wants to merge 1 commit intosystemd:mainfrom
Closed
core/unit: sort the dropin paths of a unit#35711wenjianhn wants to merge 1 commit intosystemd:mainfrom
wenjianhn wants to merge 1 commit intosystemd:mainfrom
Conversation
533830a to
8f00aa1
Compare
Fixes: ab932a6 ("core: simplify unit_need_daemon_reload() a bit") Fixes systemd#35710
8f00aa1 to
93231de
Compare
YHNdnzj
requested changes
Dec 21, 2024
Member
YHNdnzj
left a comment
There was a problem hiding this comment.
So I figure the current logic is flawed in other sense too: we shall not be heedlessly inserting to dropin_paths. Apart from not sorted properly, if a drop-in under the same name already exists under e.g. /run/, we'd be spuriously showing the one in /etc/ alongside that, while it should be replaced. Hence probably it's better to call unit_find_dropin_paths afterwards?
| q = NULL; | ||
|
|
||
| strv_uniq(u->dropin_paths); | ||
| strv_sort_uniq(u->dropin_paths); |
Member
There was a problem hiding this comment.
This seems wrong. We need to sort this based on the actual loading priorities (/etc/, /run/, /usr/local/, /usr/), not lexical order.
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: ab932a6 ("core: simplify unit_need_daemon_reload() a bit")
Fixes #35710