From c48092b666373785780a33898a3df0e88fe7ab6e Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 29 Sep 2009 18:09:27 +0200 Subject: [PATCH 1/1] =?utf8?q?oping:=20Allow=20=E2=80=9C-f=20-=E2=80=9D=20?= =?utf8?q?even=20if=20uid=20and=20euid=20differ.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Thanks to Sebastian for the idea :) --- src/mans/oping.pod | 7 ++++--- src/oping.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mans/oping.pod b/src/mans/oping.pod index fc8911d..12c3a65 100644 --- a/src/mans/oping.pod +++ b/src/mans/oping.pod @@ -58,9 +58,10 @@ Set the outgoing network device to use. Instead of specifying hostnames on the command line, read them from I. If I is B<->, read from C. -This option is only available if the real user ID (as returned by L) -and the effective user ID (as returned by L) match. This is meant -to avoid security issues when I is installed with the SUID-bit. +If the real user ID (as returned by L) and the effective user ID (as +returned by L) differ, the only argument allowed for this option is +"-" (i.Ee. standard input). This is meant to avoid security issues when +I is installed with the SUID-bit. =back diff --git a/src/oping.c b/src/oping.c index 8419710..3d1eddd 100644 --- a/src/oping.c +++ b/src/oping.c @@ -170,7 +170,7 @@ static int read_options (int argc, char **argv) break; case 'f': - if (is_setuid ()) + if (is_setuid () && (strcmp ("-", optarg) != 0)) { fprintf (stderr, "For security reasons the `-f' option " "is disabled if real and effective " -- 2.11.0