Some of those are common. I looked at similar stuff in daemontools, where runit got some of this code from, when I packaged it up with some of the other Bernstein softwares some years ago. However, you have missed the point of HASSHORTSETGROUPS. There's no point in having conditionally compiled code selected by it that uses gid_t in both codepaths. If you are going to use gid_t, you do not need the HASSHORTSETGROUPS mechanism in its entirety. Think about what it does.


In the nosh toolset, I have no such mechanisms. The code uses the <unistd.h> types, with a std::vector<gid_t> for the call to setgroups() in setuidgid-fromenv for example. The only similar mechanism picks between the very old waitpid() function and the newer (but still old, because it was SVR4) waitid() function. And only OpenBSD ever needs the code to use the former, in practice.

Reply via email to