1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-04 22:33:27 +00:00
freebsd-ports/sysutils/ascpu/files/patch-sec01

24 lines
477 B
Plaintext
Raw Normal View History

--- ascpu_x.c.orig Mon Jul 3 21:39:16 2000
+++ ascpu_x.c Mon Jul 3 21:39:19 2000
@@ -18,6 +18,7 @@
#include <nlist.h>
#include <fcntl.h>
#include <kvm.h>
+#include <sys/types.h>
#endif
#ifdef __hpux__
@@ -626,6 +627,12 @@
#ifdef DEBUG
printf("ascpu: system(%s)\n",Command);
#endif
+
+ if (setgid(getgid()) != 0)
+ err(1, "Can't drop setgid privileges");
+ if (setuid(getuid()) != 0)
+ err(1, "Can't drop setuid privileges");
+
if( ! Command ) {
return;
}