Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142460993
D52290.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
9 KB
Referenced Files
None
Subscribers
None
D52290.diff
View Options
diff --git a/tools/test/stress2/misc/fdatasync.sh b/tools/test/stress2/misc/fdatasync.sh
--- a/tools/test/stress2/misc/fdatasync.sh
+++ b/tools/test/stress2/misc/fdatasync.sh
@@ -178,7 +178,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "failed to resolve nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/fdatasync2.sh b/tools/test/stress2/misc/fdatasync2.sh
--- a/tools/test/stress2/misc/fdatasync2.sh
+++ b/tools/test/stress2/misc/fdatasync2.sh
@@ -177,7 +177,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "failed to resolve nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/fifo2.sh b/tools/test/stress2/misc/fifo2.sh
--- a/tools/test/stress2/misc/fifo2.sh
+++ b/tools/test/stress2/misc/fifo2.sh
@@ -167,7 +167,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "no such user: nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/ftruncate.sh b/tools/test/stress2/misc/ftruncate.sh
--- a/tools/test/stress2/misc/ftruncate.sh
+++ b/tools/test/stress2/misc/ftruncate.sh
@@ -170,7 +170,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "failed to resolve nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/ftruncate2.sh b/tools/test/stress2/misc/ftruncate2.sh
--- a/tools/test/stress2/misc/ftruncate2.sh
+++ b/tools/test/stress2/misc/ftruncate2.sh
@@ -185,7 +185,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "failed to resolve nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/kevent7.sh b/tools/test/stress2/misc/kevent7.sh
--- a/tools/test/stress2/misc/kevent7.sh
+++ b/tools/test/stress2/misc/kevent7.sh
@@ -236,7 +236,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "no such user: nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/killpg.sh b/tools/test/stress2/misc/killpg.sh
--- a/tools/test/stress2/misc/killpg.sh
+++ b/tools/test/stress2/misc/killpg.sh
@@ -113,7 +113,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "no such user: nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/killpg2.sh b/tools/test/stress2/misc/killpg2.sh
--- a/tools/test/stress2/misc/killpg2.sh
+++ b/tools/test/stress2/misc/killpg2.sh
@@ -77,7 +77,7 @@
if ((pw = getpwnam("TUSER")) == NULL)
err(1, "no such user: TUSER");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"TUSER\"");
diff --git a/tools/test/stress2/misc/killpg3.sh b/tools/test/stress2/misc/killpg3.sh
--- a/tools/test/stress2/misc/killpg3.sh
+++ b/tools/test/stress2/misc/killpg3.sh
@@ -109,7 +109,7 @@
if ((pw = getpwnam("TUSER")) == NULL)
err(1, "no such user: TUSER");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"TUSER\"");
diff --git a/tools/test/stress2/misc/maxproc.sh b/tools/test/stress2/misc/maxproc.sh
--- a/tools/test/stress2/misc/maxproc.sh
+++ b/tools/test/stress2/misc/maxproc.sh
@@ -103,7 +103,7 @@
err(1, "no such user: nobody");
if (priv == 0) {
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/mlockall3.sh b/tools/test/stress2/misc/mlockall3.sh
--- a/tools/test/stress2/misc/mlockall3.sh
+++ b/tools/test/stress2/misc/mlockall3.sh
@@ -130,7 +130,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "no such user: nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/mlockall7.sh b/tools/test/stress2/misc/mlockall7.sh
--- a/tools/test/stress2/misc/mlockall7.sh
+++ b/tools/test/stress2/misc/mlockall7.sh
@@ -179,7 +179,7 @@
maxlock = maxl;
if ((pw = getpwnam("nobody")) == NULL)
err(1, "failed to resolve nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/mountu.sh b/tools/test/stress2/misc/mountu.sh
--- a/tools/test/stress2/misc/mountu.sh
+++ b/tools/test/stress2/misc/mountu.sh
@@ -241,7 +241,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "no such user: nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/msync.sh b/tools/test/stress2/misc/msync.sh
--- a/tools/test/stress2/misc/msync.sh
+++ b/tools/test/stress2/misc/msync.sh
@@ -166,7 +166,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "no such user: nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/pread.sh b/tools/test/stress2/misc/pread.sh
--- a/tools/test/stress2/misc/pread.sh
+++ b/tools/test/stress2/misc/pread.sh
@@ -170,7 +170,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "no such user: nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/sched.sh b/tools/test/stress2/misc/sched.sh
--- a/tools/test/stress2/misc/sched.sh
+++ b/tools/test/stress2/misc/sched.sh
@@ -107,7 +107,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "no such user: nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/sigreturn3.sh b/tools/test/stress2/misc/sigreturn3.sh
--- a/tools/test/stress2/misc/sigreturn3.sh
+++ b/tools/test/stress2/misc/sigreturn3.sh
@@ -121,7 +121,7 @@
fprintf(stderr, "Running syscall4 as root for %s.\n",
argv[1]);
else {
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/sigreturn4.sh b/tools/test/stress2/misc/sigreturn4.sh
--- a/tools/test/stress2/misc/sigreturn4.sh
+++ b/tools/test/stress2/misc/sigreturn4.sh
@@ -147,7 +147,7 @@
fprintf(stderr, "Running sigreturn4 as root for %s.\n",
argv[1]);
else {
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/syscall4.sh b/tools/test/stress2/misc/syscall4.sh
--- a/tools/test/stress2/misc/syscall4.sh
+++ b/tools/test/stress2/misc/syscall4.sh
@@ -318,7 +318,7 @@
fprintf(stderr, "Running syscall4 as root for %s.\n",
argv[1]);
else {
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
diff --git a/tools/test/stress2/misc/tmpfs16.sh b/tools/test/stress2/misc/tmpfs16.sh
--- a/tools/test/stress2/misc/tmpfs16.sh
+++ b/tools/test/stress2/misc/tmpfs16.sh
@@ -181,7 +181,7 @@
if ((pw = getpwnam("nobody")) == NULL)
err(1, "failed to resolve nobody");
- if (setgroups(1, &pw->pw_gid) ||
+ if (setgroups(0, NULL) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
err(1, "Can't drop privileges to \"nobody\"");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 21, 5:02 AM (3 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27790843
Default Alt Text
D52290.diff (9 KB)
Attached To
Mode
D52290: stress2: Fix removal of supplementary groups
Attached
Detach File
Event Timeline
Log In to Comment