Do not report an error if control_group is already set#15
Merged
rsmarples merged 1 commit intoNetworkConfiguration:masterfrom May 9, 2020
Merged
Do not report an error if control_group is already set#15rsmarples merged 1 commit intoNetworkConfiguration:masterfrom
rsmarples merged 1 commit intoNetworkConfiguration:masterfrom
Conversation
rsmarples
requested changes
May 6, 2020
src/if-options.c
Outdated
| } | ||
| if (grp == NULL) { | ||
| logerrx("controlgroup: %s: not found", arg); | ||
| if (!ctx->control_group) { |
Member
There was a problem hiding this comment.
Can you test against != NULL please? It's more explicit and reads better in my eyes.
Also, the bracnes are not needed as the logerrx is just one line
Contributor
Author
There was a problem hiding this comment.
It actually is of type gid_t, so I don't think it'd make sense to compare it to NULL. In control.c you also test it without giving an explicit constant to compare.
src/if-options.c
Outdated
| grp = getgrnam(arg); | ||
| if (grp == NULL) { | ||
| logerrx("controlgroup: %s: not found", arg); | ||
| if (!ctx->control_group) { |
Contributor
Author
There was a problem hiding this comment.
I now dropped the braces.
rsmarples
added a commit
that referenced
this pull request
Jan 25, 2021
Do not report an error if control_group is already set
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.
After an update I noticed that dhcpcd reported an error "controlgroup: wheel: not found". Looking into the code it seems that this is due to the new privsep code not moving /etc/group in the chroot. This patch is a quick fix for the error that simply checks if control_group was already parsed successfully.
Here is what the error looked like on my machine: