[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
dhcpdprocess 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
/datais owned by therootuser (or group), thedhcpduser (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-oflag ofusermod(or `groupmod).Tests Cases
/dataowned by666:666/dataowned by0:0/dataowned by0:666Test modus operandi
Tests Results
666:666
0:0
0:666
The mixed case is not passing. It looks like an issue with
dhcpditself. Opinions?