On 2023/04/21 02:45, Juan Picca wrote: > On Thu, Apr 20, 2023 at 11:33:30PM -0600, Theo de Raadt wrote: > > But this situation does not arise, not in this program, and not in 20 other > > daemons. > > > > You changed something to cause this problem. > > Yes. > > I found a similar case in > https://cvsweb.openbsd.org/src/usr.sbin/pkg_add/OpenBSD/AddDelete.pm?rev=1.97&content-type=text/x-cvsweb-markup > but from your response maybe it's not the same. > > Sorry for the noise! > Regards, > JMPC >
Daemons are expected to be started using rcctl, which ensures a clean environment and use of the correct login class. I think either you must have started it directly without rcctl (don't do that), or set umask in login.conf (in which case, you put it in a section that is too widely used, so it needs to be better targetted). It doesn't make much sense to modify every daemon to cope with an unusual umask when the infrastructure is already there to try to give it a standard environment/settings (it will be total whack-a-mole across all daemons in base and packages to change this). pkg_add is different because it is run from the user's shell where it is expected that the umask might be changed.