-
Notifications
You must be signed in to change notification settings - Fork 96
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
[33] Make dhcpd process run as the dhcpd user and group #34
[33] Make dhcpd process run as the dhcpd user and group #34
Conversation
@yscialom Explicitly setting the uid/gid for dhcpd to My approach would be to just add an |
Hello @robinsmidsrod, could you please elaborate on what "I would instead keep the existing behavior" means? Currently, dhcpd runs as 0:0 whatever the owner of /data. This PR makes it run as 0:0 if /data is owned by 0:0, or as uid:gui otherwise. Now, running as root or running as dhcpd whose ids have been set to 0:0 is the same thing, but makes the entrypoint script much simpler as there is only one invocation of the dhcpd process. I might have misunderstood your suggestion. Can you provide at least some pseudocode so we make sure we understand each other? |
Something like this:
The main reason for doing it this way is to not change ownership/permissions of more files than absolutely needed. I try to keep the behavior as close to what the .deb package does. |
I fail to see any difference between your proposal and mine. Running as root or running as any other user with uid 0 is the same thing. Files are owned by an uid, the named displayed by stat or ls -l are only for convenience. Am I missing something? |
By not specifying But I have reconsidered and think your idea is good. Will merge. |
"By not specifying -user/-group in the dhcpd command line you get the default .deb run behavior". Ok this is what I've missed, yeah it makes sense. Let me double check if I can find any documentation on the guarantee the developers of dhcpd would have maid that -user/-group for running as root (uid 0) will be supported long time. Thank you for the merge. As I'd like it to be available on dockerhub in the short future (days or a couple weeks), I'll work with the author of the other PR to automate it :) KTGW |
Fixes issue #33.
Make the
dhcpd
process run as user and groupdhcpd
.Additional Informations
Prior to running the process, the entrypoint script make sure those user & group have the same id as the user & group owning
/data
.If
/data
is owned by theroot
user (or group), thedhcpd
user (or group) will be modified to have UID 0 (or GID). This is allowed for two users (or groups) to share the same id, this is the purpose of the-o
flag ofusermod
(or `groupmod).Tests Cases
/data
owned by666:666
/data
owned by0:0
/data
owned by0:666
Test modus operandi
Tests Results
666:666
0:0
0:666
The mixed case is not passing. It looks like an issue with
dhcpd
itself. Opinions?