Open kiryanov opened 1 month ago
It doesn't reproduce on my system What is your BSD version ? May be you run tpws not as root ? If so then --user and --uid options are not available for obvious reasons. They will cause error
14.1. I run it from root as a daemon, it drops privileges with no issues, but a call to setgroups fails. PS: setgroups invocation differs between linux and freebsd, in particular freebsd needs a primary group to be specified twice in the list of groups, maybe that’s the issue. I can do some more testing in a week or two.
the only call to setgroups is
setgroups(0,NULL);
it's intended to drop all supplimentary groups
So I have conducted quite some testing and I definitely could not make it work with setgroups() on FreeBSD 14.1 even using the FreeBSD semantics and passing the primary gid as the first member of the groups array. Maybe instead of removing the call just make the error non-fatal? Most of the code I have looked at just prints a warning if setgroups() call fails.
may be you share your test code ? i cant reproduce what you talk about
setgroups() call will fail with EPERM on FreeBSD. It renders --user and --uid options useless.