Skip to content

Commit 0d843cc

Browse files
committed
hastd: update assertion for new setgroups/getgroups behavior
We had fixed some of the assertions here, but I had overlooked one more that doesn't make any sense. We could coalesce these two at the end, but I guess it's good to be sure that getgroups(2) doesn't have some bug where we'll feed userspace a GID if it makes room for it. Reported by: S. Ross Gohlke <ross bisd ro> Fixes: 9da2fe9 ("kern: fix setgroups(2) and getgroups(2) [...]")
1 parent 1595031 commit 0d843cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sbin/hastd/subr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ drop_privs(const struct hast_resource *res)
284284
PJDLOG_VERIFY(rgid == pw->pw_gid);
285285
PJDLOG_VERIFY(egid == pw->pw_gid);
286286
PJDLOG_VERIFY(sgid == pw->pw_gid);
287-
PJDLOG_VERIFY(getgroups(0, NULL) == 1);
287+
PJDLOG_VERIFY(getgroups(0, NULL) == 0);
288288
PJDLOG_VERIFY(getgroups(1, gidset) == 0);
289289

290290
pjdlog_debug(1,

0 commit comments

Comments
 (0)