stunnel broken, realpath problem

Norman Wilson norman at oclsc.org
Sun Jun 20 22:43:34 CEST 2021


The Solaris 10 i386 stunnel package in unstable,
CSWstunnel 5.50,REV=2018.12.03, doesn't work.  It cannot
read any configuration file, always reporting

[!] Invalid configuration file name "/etc/opt/csw/stunnel/stunnel.conf"
[!] realpath: Invalid argument (22)

to standard error on startup (with whatever filename you specify,
of course).

I suspect the SPARC version is affected the same way, but I can't
easily test that at the moment.

The trouble is with realpath(3c).  Modern versions (including in
Solaris 11, I think) allow calls like s = realpath(p, NULL) to
mean realpath should malloc a buffer for the result; Solaris 10
realpath fails with EINVAL instead.  stunnel calls realpath with
second argument NULL, and doesn't expect the error.

A simple workaround is to apply a manual hack while building:

./configure
ed src/config.h <<!
/HAVE_REALPATH/d
w
q
!

i.e. remove the symbol configure made to assert that stunnel
may use realpath.

I fetched stunnel 5.59 (the latest version) directly from
www.stunnel.org, built it with that hack interposed, and all
is well.

There are probably more-graceful ways to fix this (maybe there's
an argument to ./configure to tell it to do that? maybe a simple
patch to configure.ac?).  Or maybe it's just not worth fixing,
since the bug has probably been there quite a while, and it
only affects Solaris 10.  I'm working to move to a newer OS
version myself, so it won't hurt my feelings if you decide to
let sleeping stunnels lie.  But here it is if it's worth doing.

I should note that I didn't debug the problem myself; I found
the answer on stunnel.org's mailing list.  Due credit:

https://www.stunnel.org/pipermail/stunnel-users/2018-December/006204.html

Norman Wilson
Toronto ON


More information about the users mailing list