summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-01-18 16:35:55 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-05-08 11:51:51 +0200
commit569ad251adde02dc0915758fe027e0346e50738a (patch)
tree22b6a037e8a341f658886a0fa746d93d325bbea3 /src/udev
parent717e8eda77b93ac396dc7ed325d5bcc61dfe2fa8 (diff)
downloadsystemd-569ad251adde02dc0915758fe027e0346e50738a.tar.gz
udevadm: drop pointless must_be_root() checks
Checking if we are root on the client side is generally pointless, since the privileged operation will fail anyway and we can than log what precisly went wrong. A check like this makes sense only if: - we need to do some expensive unprivileged operation before attempting the privileged operation, and the check allows us avoid wasting resources. - the privileged operation would fail but in an unclear way. Neither of those cases applies here. This fixes calls like 'udevadm control -h' as unprivileged user.
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udevadm-control.c4
-rw-r--r--src/udev/udevadm-trigger.c6
2 files changed, 0 insertions, 10 deletions
diff --git a/src/udev/udevadm-control.c b/src/udev/udevadm-control.c
index f9b3e95794..82e2514932 100644
--- a/src/udev/udevadm-control.c
+++ b/src/udev/udevadm-control.c
@@ -73,10 +73,6 @@ int control_main(int argc, char *argv[], void *userdata) {
{}
};
- r = must_be_root();
- if (r < 0)
- return r;
-
if (running_in_chroot() > 0) {
log_info("Running in chroot, ignoring request.");
return 0;
diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c
index b7dafb7755..144b464d24 100644
--- a/src/udev/udevadm-trigger.c
+++ b/src/udev/udevadm-trigger.c
@@ -301,12 +301,6 @@ int trigger_main(int argc, char *argv[], void *userdata) {
}
}
- if (!arg_dry_run || ping) {
- r = must_be_root();
- if (r < 0)
- return r;
- }
-
if (ping) {
_cleanup_(udev_ctrl_unrefp) struct udev_ctrl *uctrl = NULL;