<div dir="ltr">No problem, anyway this was an assumption but I hadn't any CentOS to confirm or disprove that theory.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 13, 2019 at 2:55 PM Peter Pentchev <<a href="mailto:roam@ringlet.net">roam@ringlet.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Feb 13, 2019 at 02:31:00PM +0100, Flo Rance wrote:<br>
> <br>
> On Wed, Feb 13, 2019 at 1:23 PM Peter Pentchev <<a href="mailto:roam@ringlet.net" target="_blank">roam@ringlet.net</a>> wrote:<br>
> <br>
> > On Wed, Feb 13, 2019 at 01:12:54PM +0100, Flo Rance wrote:<br>
> > > Regards,<br>
> > > Flo<br>
> > ><br>
> > > On Wed, Feb 13, 2019 at 1:00 PM tom <<a href="mailto:posturne@gmail.com" target="_blank">posturne@gmail.com</a>> wrote:<br>
> > ><br>
> > > > Hello,<br>
> > > ><br>
> > > > > Are you sure 'foobar.remote.site' should resolve?<br>
> > > > > Does "ping foobar.remote.site" work?<br>
> > > ><br>
> > > > yes, the host is resolved on commandline and other services on this<br>
> > > > system can reach this host.<br>
> > > ><br>
> > > ><br>
> > > > > Do you have a /var/run/stunnel/etc/resolv.conf file?<br>
> > > ><br>
> > > > No at this time I dont have this file, but it doesnt change anything<br>
> > > > if I copy the original from /etc to this lokation. But this brings me<br>
> > > > to the point try to dissable chroot and in this case stunnel is<br>
> > > > working as expected. So far so good - there is something wrong in the<br>
> > > > chroot jail.<br>
> > > ><br>
> > > > I try to put it to /var/run/stunnel - no luck, but maybe there are<br>
> > > > other files missing as well?<br>
> > ><br>
> > > If you want to resolv hostnames using resolv.conf file, you need the<br>
> > > appropriate library libresolv which is part of libc.<br>
> > > So you'll need to copy the libc librairies in your chroot environment.<br>
> ><br>
> > Mmm, I don't think that the resolver libraries are loaded dynamically;<br>
> > they are usually loaded in the stunnel binary at startup.<br>
><br>
> Ok, but in that case you should remove "delay = yes" and the hostname will<br>
> be resolved at startup, before chroot<br>
<br>
This would be true if the resolver libraries are loaded dynamically...<br>
which seems to be true. I just found a CentOS 7 system to test on, and<br>
it seems that libnss loads its modules dynamically, grrrrr.<br>
<br>
OK, so, tom, you should also find your libnss_* libraries - the easiest<br>
way is through `ldconfig -p | fgrep -e libnss_files` - and copy all of<br>
the libnss_*.so* (both the *.so ones and the *.so.something ones) into<br>
the corresponding directories in your chroot. I believe that the ones<br>
in the /lib64 directory should be enough - e.g. I think that it might be<br>
enough to do this:<br>
<br>
mkdir /var/run/stunnel/lib64<br>
cp -p /lib64/libnss_*.so* /var/run/stunnel/lib64/<br>
<br>
...but if this doesn't work, you should also copy all others from all<br>
the directories mentioned in the `ldconfig -p | fgrep -e libnss_files`<br>
output.<br>
<br>
Sorry for doubting the "dynamically loaded resolver modules" idea at<br>
first :(<br>
<br>
G'luck,<br>
Peter<br>
<br>
-- <br>
Peter Pentchev roam@{<a href="http://ringlet.net" rel="noreferrer" target="_blank">ringlet.net</a>,<a href="http://debian.org" rel="noreferrer" target="_blank">debian.org</a>,FreeBSD.org} <a href="mailto:pp@storpool.com" target="_blank">pp@storpool.com</a><br>
PGP key: <a href="http://people.FreeBSD.org/~roam/roam.key.asc" rel="noreferrer" target="_blank">http://people.FreeBSD.org/~roam/roam.key.asc</a><br>
Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13<br>
_______________________________________________<br>
stunnel-users mailing list<br>
<a href="mailto:stunnel-users@stunnel.org" target="_blank">stunnel-users@stunnel.org</a><br>
<a href="https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users" rel="noreferrer" target="_blank">https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users</a><br>
</blockquote></div>