mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-28 09:36:56 -04:00
remove root check
We can perfectly do icmp without root by using capabalities. So, instead of doing unsufficient checks beforehand, we just try and fail if it doesn't work. Signed-off-by: Danijel Tasov <m@rbfh.de>
This commit is contained in:
parent
f5c5a7438f
commit
8272d73e57
2 changed files with 0 additions and 16 deletions
|
|
@ -300,19 +300,6 @@ char *np_escaped_string (const char *string) {
|
|||
|
||||
int np_check_if_root(void) { return (geteuid() == 0); }
|
||||
|
||||
int np_warn_if_not_root(void) {
|
||||
int status = np_check_if_root();
|
||||
if(!status) {
|
||||
printf(_("Warning: "));
|
||||
printf(_("This plugin must be either run as root or setuid root.\n"));
|
||||
printf(_("To run as root, you can use a tool like sudo.\n"));
|
||||
printf(_("To set the setuid permissions, use the command:\n"));
|
||||
/* XXX could we use something like progname? */
|
||||
printf("\tchmod u+s yourpluginfile\n");
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the value from key/value pairs, or return NULL. The value returned
|
||||
* can be free()ed.
|
||||
|
|
|
|||
|
|
@ -417,9 +417,6 @@ main(int argc, char **argv)
|
|||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
/* print a helpful error message if geteuid != 0 */
|
||||
np_warn_if_not_root();
|
||||
|
||||
/* we only need to be setsuid when we get the sockets, so do
|
||||
* that before pointer magic (esp. on network data) */
|
||||
icmp_sockerrno = udp_sockerrno = tcp_sockerrno = sockets = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue