summaryrefslogtreecommitdiffstats
path: root/src/udev/udevadm-trigger.c
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/udevadm-trigger.c
parentMerge pull request #12475 from yuwata/network-fix-12452 (diff)
downloadsystemd-569ad251adde02dc0915758fe027e0346e50738a.tar.xz
systemd-569ad251adde02dc0915758fe027e0346e50738a.zip
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/udevadm-trigger.c')
-rw-r--r--src/udev/udevadm-trigger.c6
1 files changed, 0 insertions, 6 deletions
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;