main: drop capabilities of userhelpers before ours
First drop the capabilities of the userhelpers before dropping our own, otherwise we might not be allowed to drop the capabilities of the userhelpers. Especially, if we want to drop CAP_SYS_MODULE. Credits: Matteo Sasso
This commit is contained in:
+5
-5
@@ -1509,16 +1509,16 @@ int main(int argc, char *argv[]) {
|
||||
log_error("Failed to adjust timer slack: %m");
|
||||
|
||||
if (arg_capability_bounding_set_drop) {
|
||||
r = capability_bounding_set_drop(arg_capability_bounding_set_drop, true);
|
||||
if (r < 0) {
|
||||
log_error("Failed to drop capability bounding set: %s", strerror(-r));
|
||||
goto finish;
|
||||
}
|
||||
r = capability_bounding_set_drop_usermode(arg_capability_bounding_set_drop);
|
||||
if (r < 0) {
|
||||
log_error("Failed to drop capability bounding set of usermode helpers: %s", strerror(-r));
|
||||
goto finish;
|
||||
}
|
||||
r = capability_bounding_set_drop(arg_capability_bounding_set_drop, true);
|
||||
if (r < 0) {
|
||||
log_error("Failed to drop capability bounding set: %s", strerror(-r));
|
||||
goto finish;
|
||||
}
|
||||
}
|
||||
|
||||
if (arg_running_as == SYSTEMD_USER) {
|
||||
|
||||
Reference in New Issue
Block a user