1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
Description: Give more sensible message when running as non-root
Author: Petter Reinholdtsen <pere@debian.org>
Bug-Debian: http://bugs.debian.org/660946
Forwarded: no
Reviewed-By: Petter Reinholdtsen <pere@hungry.com>
Last-Update: 2013-10-12
Index: pchar-alioth/README
===================================================================
--- pchar-alioth.orig/README 2017-08-05 08:26:29.656106908 +0200
+++ pchar-alioth/README 2017-08-05 08:26:29.652106880 +0200
@@ -12,6 +12,10 @@
latency, and loss of links along an end-to-end path through the
Internet. pchar works in both IPv4 and IPv6 networks.
+The pchar program requires root privileges to send the network
+packages. It might be safe to make suid root, but no-one know for
+sure.
+
As of pchar-1.5, this program is no longer under active development,
and no further releases are planned.
Index: pchar-alioth/main.cc
===================================================================
--- pchar-alioth.orig/main.cc 2017-08-05 08:26:29.656106908 +0200
+++ pchar-alioth/main.cc 2017-08-05 08:26:29.652106880 +0200
@@ -339,6 +339,11 @@
int c; // getopt
Pctest *pct = NULL; // test structure
+ if (0 != geteuid()) {
+ fprintf(stderr, "error: the pchar program requries root privilges to work.\n");
+ return 0;
+ }
+
// Parse command-line arguments using getopt
while ((c = getopt(argc, argv, "a:b:cCd:g:G:hH:i:I:l:m:M:np:P:qR:r:s:St:T:vVw:")) != -1) {
|