X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fsonar.c;h=2b0171d9abd6a9081151c58642a81c5287e17ba5;hp=b3f3cb6a1f1211b589de785f48ede253bc2e0edc;hb=ccb7f4903325f92555a9722bba74b58346654ba0;hpb=0d6b320def9180cf907ceaed56b23a972a11b757 diff --git a/hacks/sonar.c b/hacks/sonar.c index b3f3cb6a..2b0171d9 100644 --- a/hacks/sonar.c +++ b/hacks/sonar.c @@ -2171,7 +2171,14 @@ screenhack(Display *dpy, Window win) sensor = 0; # ifdef HAVE_PING - sensor_info = (void *) init_ping(); + /* init_ping() will fail if not root, so checking the effective uid + isn't necessary -- except that on some systems, it makes some + SELinux bullshit show up in syslog, which gets people's panties + in a bunch. */ + if (geteuid () == 0) + sensor_info = (void *) init_ping(); + else + sensor_info = 0; # else /* !HAVE_PING */ sensor_info = 0; parse_mode (0); /* just to check argument syntax */