summaryrefslogtreecommitdiffstats
path: root/sysutils/ascpu
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-01-30 02:19:34 +0000
committerkris <kris@FreeBSD.org>2000-01-30 02:19:34 +0000
commit7d523daaecae36acee8a27f1fd59d21825914104 (patch)
tree45ae281773a5758f480412c88b5dfc0c52048986 /sysutils/ascpu
parent3cd11a4c22e453679b74b66f2246e3e184348e67 (diff)
downloadFreeBSD-ports-7d523daaecae36acee8a27f1fd59d21825914104.zip
FreeBSD-ports-7d523daaecae36acee8a27f1fd59d21825914104.tar.gz
Drop privileges before executing user commands
Submitted by: jedgar
Diffstat (limited to 'sysutils/ascpu')
-rw-r--r--sysutils/ascpu/files/patch-sec0121
1 files changed, 21 insertions, 0 deletions
diff --git a/sysutils/ascpu/files/patch-sec01 b/sysutils/ascpu/files/patch-sec01
new file mode 100644
index 0000000..d54a776
--- /dev/null
+++ b/sysutils/ascpu/files/patch-sec01
@@ -0,0 +1,21 @@
+--- ascpu_x.c.orig Thu Dec 16 17:45:26 1999
++++ ascpu_x.c Wed Dec 29 20:47:32 1999
+@@ -6,6 +6,7 @@
+ * This software is distributed under GPL. For details see LICENSE file.
+ */
+
++#include <sys/types.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <fcntl.h>
+@@ -585,6 +586,10 @@
+ #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");
+ system( Command );
+ }
+ break;
OpenPOWER on IntegriCloud