freebsd-ports/sysutils/ascpu/files/patch-sec01
Maxim Sobolev 749e254514 Update to 1.9.
PR:		19679
Submitted by:	maintainer
2000-07-04 10:09:52 +00:00

24 lines
477 B
Plaintext

--- 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;
}