Hp-Ux

Stunnel 和 hpux:為什麼會出現這個錯誤?

  • April 4, 2019

我已經使用這些選項在 hpux 上編譯了一個 stunnel 建構

./configure \
 --prefix=/opt/stunnel \
 --sbindir=/opt/stunnel/sbin \
 --mandir=/opt/stunnel/man \
 --docdir=/opt/stunnel/doc \
 --localstatedir=/var/opt/stunnel \
 --with-ssl=/usr/local \
 --disable-libwrap

建構成功,但 stunnel 無法啟動

/opt/stunnel/bin/stunnel /etc/opt/stunnel/stunnel.conf
[ ] Clients allowed=1000
[.] stunnel 5.50 on ia64-hp-hpux11.31 platform
[.] Compiled with OpenSSL 1.0.2q  20 Nov 2018
[.] Running  with OpenSSL 1.0.2k  26 Jan 2017
[.] Threading:PTHREAD Sockets:POLL,IPv6 TLS:ENGINE,FIPS,OCSP,PSK,SNI
[ ] errno: (*__errno())
[!] Invalid configuration file name "/etc/opt/stunnel/stunnel.conf"
[!] realpath: Invalid argument (22)
[ ] Deallocating section defaults

配置文件是正確的,因為在相同版本的linux和solaris上可以正常工作。我看到這兩行:

[.] Compiled with OpenSSL 1.0.2q  20 Nov 2018
[.] Running  with OpenSSL 1.0.2k  26 Jan 2017

我有兩個版本的 openssl,當然不可能同時刪除兩個版本或只刪除一次,因為會破壞很多 deps。我也嘗試過換行

 --with-ssl=/usr/local \

 --with-ssl=/opt/openssl\

並且……不起作用。同樣的錯誤

/opt/stunnel/bin/stunnel /etc/opt/stunnel/stunnel.conf
[ ] Clients allowed=1000
[.] stunnel 5.50 on ia64-hp-hpux11.31 platform
[.] Compiled/running with OpenSSL 1.0.2k  26 Jan 2017
[.] Threading:PTHREAD Sockets:POLL,IPv6 TLS:ENGINE,FIPS,OCSP,PSK,SNI
[ ] errno: (*__errno())
[!] Invalid configuration file name "/etc/opt/stunnel/stunnel.conf"
[!] realpath: Invalid argument (22)
[ ] Deallocating section defaults

這是文件conf。

#server
chroot = /var/opt/stunnel
setuid = stunnel
setgid = stunnel
pid = /stunnel.pid
debug = 1
foreground = no
cert = /etc/ssl/certs/stunnel.pem
key = /etc/ssl/private/stunnel.pem
options = NO_SSLv2
options = NO_SSLv3
sslVersion = TLSv1.2
[TELNET]
accept=0.0.0.0:5853
connect=localhost:23

根據 HP-UX 11.31 手冊頁,呼叫中的Invalid argument錯誤 ( EINVAL)realpath(3X)表示指向要解析的路徑名或已解析名稱的緩衝區的指針為 NULL。

這可能是檢查配置文件名有效性的程式碼部分中的某種指針處理錯誤。這也可以解釋前面的Invalid configuration file name錯誤消息。

引用自:https://unix.stackexchange.com/questions/510506