[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: resolv binary (partman-nbd) broken



On Mon, Feb 24, 2014 at 09:46:08PM +0300, Cyril Brulebois wrote:
> Wouter Verhelst <wouter@debian.org> (2014-02-21):
> > It seemed to work when I originally wrote it; but today, I noticed this:
> > 
> > wouter@carillon:~/debian/debian-installer/packages/partman-nbd$ ./resolv db.debian.org
> > pÐ@
> > 82.195.75.106
> > 
> > The first is supposed to be an IPv6 address; instead, it is junk.
> > 
> > I'm not sure what exactly happens, nor what the bug in the code is. Any
> > help would be welcome.
> 
> You want to check “man inet_ntop” and try:
> 
> -                               inet_ntop(rp->ai_family, addr, host, rp->ai_addrlen);
> +                               inet_ntop(rp->ai_family, addr, host, NI_MAXHOST);
> 
> or probably better, in case host's declaration changes over time:
> -                               inet_ntop(rp->ai_family, addr, host, rp->ai_addrlen);
> +                               inet_ntop(rp->ai_family, addr, host, sizeof(host));

D'oh. Thanks, fix committed (the latter of the two, which does indeed seem slightly more robust)

> > [1] It might make sense to ship it with something more generic, but I
> >     couldn't think of a good udeb to put it in.
> 
> Somewhere inside src:debian-installer-utils maybe? di-utils would look
> right to me at first glance.

Ah, yes. I suppose that could work. I'll move it there.

-- 
This end should point toward the ground if you want to go to space.

If it starts pointing toward space you are having a bad problem and you
will not go to space today.

  -- http://xkcd.com/1133/


Reply to: