[buildd-tools-devel] Bug#841165: Bug#841165: sbuild-createchroot overwrites /etc/hosts and creates a file without IPv6 entries

Johannes Schauer josch at debian.org
Tue Oct 18 11:05:58 UTC 2016


Control: tag -1 + pending

Hi,

Quoting Raphaël Hertzog (2016-10-18 10:33:52)
> Extract from the code:
> 
>     # Run debootstrap with specified options.
>     if (!$conf->get('SETUP_ONLY')) {
>         !system($debootstrap, @args) or die "E: Error running $debootstrap_bin";
>     }
> 
>     # Set up minimal /etc/hosts.
>     my $hosts = "${target}/etc/hosts";
>     open(HOSTS, ">$hosts")
>         or die "Can't open $hosts for writing";
>     print HOSTS "127.0.0.1 " . $conf->get('HOSTNAME') . " localhost";
>     close HOSTS or die "Can't close $hosts";
> 
> So you can see that:
> - /etc/hosts is overwritten even when it already exists
>   (netbase which is priority important is creating the file during
>   debootstrap in theory)
> - the only entry added is the IPv4 localhost while netbase is creating
>   this file:
>         127.0.0.1       localhost
>         ::1             localhost ip6-localhost ip6-loopback
>         ff02::1         ip6-allnodes
>         ff02::2         ip6-allrouters
> 
> I have seen some test suites relying on the fact that there was
> an IPv6 address associated to "localhost" or "ip6-localhost" so it
> would be nice if sbuild-createchroot could get this right as well.

netbase is Priority:important but it doesn't get installed by
sbuild-createchroot which drives debootstrap with --variant=buildd. How are you
using sbuild-createchroot so that it installs netbase? Are you using the
--include option?

Nevertheless, there is now a commit in my git which doesn't overwrite
/etc/hosts if it exists and if it doesn't it now writes the exact same content
that would also have been written by the current version of the netbase
package.

Thanks!

cheers, josch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20161018/427ddd72/attachment.sig>


More information about the Buildd-tools-devel mailing list