summaryrefslogtreecommitdiffstats
path: root/hacks/glx/sonar.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/sonar.c')
-rw-r--r--hacks/glx/sonar.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hacks/glx/sonar.c b/hacks/glx/sonar.c
index ddbb79f..e4e0b86 100644
--- a/hacks/glx/sonar.c
+++ b/hacks/glx/sonar.c
@@ -1,4 +1,4 @@
-/* sonar, Copyright (c) 1998-2018 Jamie Zawinski and Stephen Martin
+/* sonar, Copyright (c) 1998-2020 Jamie Zawinski and Stephen Martin
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -935,7 +935,11 @@ init_sensor (ModeInfo *mi)
ping_arg, ping_timeout, resolve_p, times_p,
debug_p);
else
- setuid(getuid()); /* Disavow privs if not pinging. */
+ { /* Disavow privs if not pinging. */
+ if (setuid(getuid()) == -1) abort();
+ }
+
+ setuid(getuid());
sp->start_time = double_time (); /* for error message timing */