nslookup incorrect exit code

Denys Vlasenko vda.linux at googlemail.com
Wed Jan 9 13:15:50 UTC 2019


Fixed in git, thanks

On Wed, Jan 9, 2019 at 12:01 PM Slava Bacherikov <slava at bacher09.org> wrote:
>
> Hi,
>
> It looks like busybox recently changed behavior of nslookup and this
> broke some scripts. Previously, nslookup returned 1 as exit code if DNS
> server returned NXDOMAIN, or some other failure. Actually, nslookup from
> bind-utils also have same behavior.
>
> But recently, nslookup in busybox return zero exit code in case of
> NXDOMAIN or some other failure.
>
> Few examples:
>
> original nslookup:
> nslookup baddomain > /dev/null; echo $?
> 1
>
> busybox:
> nslookup baddomain > /dev/null; echo $?
> 0
>
> original nslookup:
> nslookup busybox.net 205.251.193.145 > /dev/null; echo $?
> 1
>
> busybox:
> nslookup busybox.net 205.251.193.145 > /dev/null; echo $?
> 0
>
> Here's one of use cases where it was used:
> https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#init-containers-in-use
> . Now this is broken.
>
> I've also attached patch that mimic old behavior.
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list