-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow setting user for all modules and capabilities per module #100
Conversation
737f50b
to
c733613
Compare
one thing that we also need to fix: if one child cannot be forked (e.g. capabilities config wrong), manager exits but the already forked children are not killed |
that is, what |
I think that's because that flag is cleared when executing setuid, so we will have to implement a workaround along these lines: |
Good find, I wasn't aware of that yet. |
a10fd78
to
1237657
Compare
8b2da9c
to
4f84d83
Compare
Hi in this PR quite nice refactoring is done, and all system-specific functions are encapsulated in a dedicated file. Do you think Do you think it makes sense to have one header |
4f84d83
to
21993a6
Compare
PR_SET_PDEATHSIG is now fixed, it is set after the user change. Also support to switch back to root user in manager for restarting of modules when admin panel/controller is used was added. If admin panel is disabled (which should be done on real deployments) manager does not have the caps to switch back from unprivileged user. |
When setting system_user="myuser" property under settings in a config file all modules are started as this user and its default gid. After starting all modules the manager also switches to this user. For each module, special Linux capabilities can be specified with e.g. capabilities: "cap_chown+ep" in the module section. The manager will need to start as root or sufficient capabilities to do that. If no user/capabilities are specified no change happens. Implementation changes - using SECBITS_KEEP_CAP in order to keep capabilities, when changing real user id - using ambient capability set, in order to keep capabilities, when execve'ing - changed name from 'system_user' to 'run_as_user' - changed schema for capabilities in config file from string to array of strings - dropped 'run_as_user' from ModuleStartInfo, could be added back, when configuration is possible - known bugs: - incomplete error handling, when setting of capabilities fails - manager process doesn't change user yet (otherwise restarting of modules won't work), should use effective user id here - controller process doesn't get terminated, when forking process fails due to permission problems Signed-off-by: aw <aw@pionix.de> Signed-off-by: Cornelius Claussen <cc@pionix.de> tmp Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
6a573a5
to
cc628b7
Compare
Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
Signed-off-by: Cornelius Claussen <cc@pionix.de>
When setting system_user="myuser" property under settings in a config file all modules are started as this user and its default gid.
After starting all modules the manager also switches to this user.
For each module, special Linux capabilities can be specified with e.g. capabilities: "cap_chown+ep"
in the module section.
The manager will need to start as root or sufficient capabilities to do that. If no user/capabilities are specified no change happens.