<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 14, 2017 at 7:59 AM, Adam Borowski <span dir="ltr"><<a href="mailto:kilobyte@angband.pl" target="_blank">kilobyte@angband.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>On Sat, May 13, 2017 at 08:44:15PM +0200, Michael Stapelberg wrote:<br>
> Sorry for the late reply.<br>
><br>
> Adam, could you run the attached example program (derived from the<br>
> getaddrinfo and getnameinfo manpages) please? The output should help us<br>
> narrow down whether the problem is with the application code of sslh or<br>
> something in the environment.<br>
><br>
> Use: gcc -Wall -o gai gai.c && ./gai localhost 9002<br>
<br>
</span>On all three machines, it looks fine:<br>
.----<br>
printing getaddrinfo(localhost, 9002) results:<br>
<br>
ai_family = 10<br>
ai_socktype = 2<br>
ai_protocol = 17<br>
rp->ai_addrlen = 28<br>
host=::1, serv=9002<br>
<br>
ai_family = 2<br>
ai_socktype = 2<br>
ai_protocol = 17<br>
rp->ai_addrlen = 16<br>
host=127.0.0.1, serv=9002<br>
<br>
done<br>
`----<br></blockquote><div><br></div><div>This seems correct.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Inside the chroot:<br>
.----<br>
[/srv/sbuild/stretch-armhf/tmp<wbr>]# cp -p /tmp/gai .<br>
[/srv/sbuild/stretch-armhf/tmp<wbr>]# chroot ..<br>
(stretch-armhf-sbuild)root@kho<wbr>ldan:/# tmp/gai localhost 9002<br>
printing getaddrinfo(localhost, 9002) results:<br>
<br>
ai_family = 2<br>
ai_socktype = 2<br>
ai_protocol = 17<br>
rp->ai_addrlen = 16<br>
host=127.0.0.1, serv=9002<br>
<br>
ai_family = 2<br>
ai_socktype = 2<br>
ai_protocol = 17<br>
rp->ai_addrlen = 16<br>
host=127.0.0.1, serv=9002<br>
<br>
done<br>
`----<br></blockquote><div><br></div><div>This seems incorrect: the results are two IPv4 addresses (<a href="http://127.0.0.1:9002" target="_blank">127.0.0.1:9002</a>) as opposed to one IPv6 and one IPv4 address (or just one IPv4 address).</div><div><br></div><div>I can actually reproduce this issue on <a href="http://abel.debian.org">abel.debian.org</a> (armhf porterbox):</div><div><br></div><div>On abel, my gai test program returns ::1, 127.0.0.1.</div><div>On abel within an schroot, my gai test program returns 127.0.0.1, 127.0.0.1.</div><div><br></div><div>Looking at /etc/hosts within the schroot, I see:</div><div><div>127.0.0.1 localhost</div><div>127.0.0.1 localhost ip6-localhost ip6-loopback</div><div>172.28.17.11 <a href="http://abel.debian.org">abel.debian.org</a> abel</div></div><div><br></div><div>Modifying /etc/hosts by replacing ::1 with 127.0.0.1 results in being able to reproduce the issue on other machines as well.</div><div><br></div><div>This has already caused issues in other packages (e.g. rustc), and is tracked as Debian bug #842634.</div><div><br></div><div>Now, the next question is: where does this /etc/hosts come from? The file is present in the above form directly after unpacking the schroot tarball, before even entering the schroot:</div><div><br></div><div>abel% sessionid=$(schroot -b -c sid)<br></div><div>abel% cat /srv/chroot/schroot-unpack/$sessionid/etc/hosts</div><div><div>127.0.0.1 localhost</div><div>127.0.0.1 localhost ip6-localhost ip6-loopback</div><div>172.28.17.11 <a href="http://abel.debian.org">abel.debian.org</a> abel</div></div><div><br></div><div>Running debootstrap does not produce an /etc/hosts in --variant=minbase and --variant=buildd. When run without --variant, it does produce an /etc/hosts, but that looks correct:</div><div><br></div><div>midna% sudo debootstrap --variant=minbase stretch /tmp/bootstrap <a href="http://deb.debian.org/debian">http://deb.debian.org/debian</a><br></div><div>midna% cat /tmp/bootstrap/etc/hosts</div><div>cat: /tmp/bootstrap/etc/hosts: No such file or directory</div><div>midna% sudo rm -rf /tmp/bootstrap</div><div>midna% sudo debootstrap stretch /tmp/bootstrap <a href="http://deb.debian.org/debian">http://deb.debian.org/debian</a></div><div>midna% cat /tmp/bootstrap/etc/hosts </div><div>127.0.0.1<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>localhost</div><div>::1<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>localhost ip6-localhost ip6-loopback</div><div>ff02::1<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>ip6-allnodes</div><div>ff02::2<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>ip6-allrouters</div><div><br></div><div>So, where does the file get mangled? I can’t find any traces in the schroot and sbuild sources. Does anyone know by chance?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Meow!<br>
<div class="gmail-m_2150854343360112235HOEnZb"><div class="gmail-m_2150854343360112235h5">--<br>
Don't be racist. White, amber or black, all beers should be judged based<br>
solely on their merits. Heck, even if occasionally a cider applies for a<br>
beer's job, why not?<br>
On the other hand, corpo lager is not a race.<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail-m_2150854343360112235gmail_signature">Best regards,<br>Michael</div>
</div></div>