From e5b5db2463f0e4beefe10e73842d874ff3d18237 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 31 Aug 2012 08:01:57 +0200 Subject: [PATCH] lldpctl: just require access to the socket for actions, not root priv Instead of checking for root, we check that we don't have additional privileges due to setuid or setgid binary. --- src/client/lldpctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/lldpctl.c b/src/client/lldpctl.c index a96057fc..e848d05a 100644 --- a/src/client/lldpctl.c +++ b/src/client/lldpctl.c @@ -153,8 +153,9 @@ main(int argc, char *argv[]) log_init(debug, __progname); - if ((action != 0) && (getuid() != 0)) { - fatalx("mere mortals may not do that, 'root' privileges are required."); + if ((action != 0) && + (getuid() != geteuid() || getgid() != getegid())) { + fatalx("mere mortals may not do that, admin privileges are required."); } conn = lldpctl_new(NULL, NULL, NULL); -- 2.39.5