Hi Omar,

On Sat, 9 Mar 2024, Omar Polo wrote:

Now, back to the problem, the issue is that on NetBSD seteuid() breaks
setuid() and that inbetween 7.3 and 7.4 I lost the check for the
setreuid() function.  So, in openbsd-compat/resuid.c we end up calling
seteuid() and then setuid(), which fails due to the previous seteuid()
call.  It's a bit confusing! :)

However, I believe this diff fixes smtpd on NetBSD, please let me know.

diff /home/op/w/opensmtpd
commit - 34723692d48c5bd4d54150e60fb3a1dcd7663e2b
path + /home/op/w/opensmtpd
blob - 948c865875938d34d9540267a15ee3de6464b1bc
file + configure.ac
--- configure.ac
+++ configure.ac
@@ -147,6 +147,7 @@ AC_CHECK_FUNCS([ \
        getspnam \
        malloc_conceal \
        pledge \
+       setreuid \
        setsid \
        sigaction \
        strnvis \

Yes, that fixes it:

$ sudo ./local/sbin/smtpd -d -f /usr/pkg/etc/smtpd/smtpd.conf
info: OpenSMTPD 7.5.0-portable starting
dnsbl: config|smtpd-version|7.5.0-portable
dnsbl: config|smtp-session-timeout|300
dnsbl: config|subsystem|smtp-in
dnsbl: config|admd|olafpi.ovaltofu.org
dnsbl: config|ready

Thank you very much for the fixes !


Reply via email to