Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Laurent Bercot
> Quick fix, major absolutely correct: > > /etc/nsswitch contains line: > > hosts: files dns > > /etc/host.conf contains: > > order hosts, bind Ah, yes, I confused the syntaxes, sorry about that. /etc/nsswitch.conf indeed contains something like "hosts: files dns" to configure NSS. The th

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread ra...@gmx.de
Hi Rich ! > On Sun, Jul 08, 2012 at 05:36:08PM +0200, ra...@gmx.de wrote: > > Full ack! Are you able to provide a new getent applet (deleting the > > current nslookup)? (Sorry currently can't do development work due to > > personal/health restrictions). > I question the benefit of deleting a util

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Rich Felker
On Sun, Jul 08, 2012 at 05:36:08PM +0200, ra...@gmx.de wrote: > Full ack! Are you able to provide a new getent applet (deleting the > current nslookup)? (Sorry currently can't do development work due to > personal/health restrictions). I question the benefit of deleting a utility that some people

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread ra...@gmx.de
Hi Paul ! > The nslookup program does not do NSS lookup. We are talking about Busybox nslookup. As Ralf mentioned it does NSS lookup. > If the busybox version of nslookup uses nsswitch.conf / ... then it's > not correct Sure ... Ralf told this already ... The Busybox nslookup is claiming to do

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Paul Smith
On Sun, 2012-07-08 at 15:59 +0200, ra...@gmx.de wrote: > > >> as I've said is previous mail, I'll think on how I can create a > > >> getent applet and pitch it up instead. > > > > > > That's what I meant by my comment. > > > > > > > cool :) > > cool, yes ... but as Ralf mentioned, we already ha

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread ra...@gmx.de
> >> as I've said is previous mail, I'll think on how I can create a > >> getent applet and pitch it up instead. > > > > That's what I meant by my comment. > > > > cool :) cool, yes ... but as Ralf mentioned, we already have that applet, with just a different output format: nslookup (accepting

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread ra...@gmx.de
Hi Laurent ! Quick fix, major absolutely correct: /etc/nsswitch contains line: hosts: files dns /etc/host.conf contains: order hosts, bind ... which usually doubles something? Harald ___ busybox mailing list busybox@busybox.net http://lists.busybox

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Eial Czerwacki
On 07/08/2012 04:01 PM, Paul Smith wrote: > On Sun, 2012-07-08 at 08:22 +0300, Eial Czerwacki wrote: >> On 07/05/2012 06:41 PM, Paul Smith wrote: >>> If you can use a getent applet instead, and one is created and added to >>> busybox, that would be better for everyone of course. >>> >>> Cheers! >>

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Paul Smith
On Sun, 2012-07-08 at 08:22 +0300, Eial Czerwacki wrote: > On 07/05/2012 06:41 PM, Paul Smith wrote: > > If you can use a getent applet instead, and one is created and added to > > busybox, that would be better for everyone of course. > > > > Cheers! > > offering me to use a applet that isn't eve

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Laurent Bercot
> It was Laurent who mentioned dnsip. And I did for a reason. (Time for a little rant.) The root of the problem here is that historically, there were different mechanisms used to perform "human-readable name" -> "IP address" resolution. DNS was one of them, and ended up being the most widely u

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Eial Czerwacki
Ralf, On 07/08/2012 03:25 PM, Ralf Friedl wrote: > What I don't understand is why you even consider some kB significant if > you have an USB storage device. the fact that I use USB storage device doesn't means that I have plenty of room, I have very limited root for the actual boot system. why I

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Ralf Friedl
Eial Czerwacki wrote: On 07/08/2012 01:57 PM, Ralf Friedl wrote: Eial Czerwacki wrote: On 07/08/2012 01:27 PM, Ralf Friedl wrote: Looking at the source busybox-1.19.2/networking/nslookup.c it's simply not possible that the output of system 1 comes from busybox 1.19.2.

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread ra...@gmx.de
Hi Eial ! > nslookup is not a valid option currently. > I cannot take in account all possible outputs. You shall not consider different outputs, you shall fix the bug here (or at least help to fix). It is not correct that you receive different output format. With correct output nslookup shall giv

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Eial Czerwacki
Harald, On 07/08/2012 02:04 PM, ra...@gmx.de wrote: > Different DHCP server config shall not give different nslookup output > if device is configured for same IP address. So there is usually > something wrong. I think it's best to find the reason for this > difference and to fix it. > > Otherwis

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Ralf Friedl
Harald Becker wrote: By the way, the applet nslookup is misleading, because it uses getaddrinfo instead of a DNS query. As a consequence, there are even answers from non existing DNS-servers. Whops ... so Busybox nslookup does the job of 'getent hosts' (or one of its alikes) ... and not a

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Eial Czerwacki
On 07/08/2012 01:57 PM, Ralf Friedl wrote: > Eial Czerwacki wrote: >> On 07/08/2012 01:27 PM, Ralf Friedl wrote: >> >>> Looking at the source busybox-1.19.2/networking/nslookup.c it's simply >>> not possible that the output of system 1 comes from busybox 1.19.2. >>> >> but still I do see tw

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread ra...@gmx.de
Hi Eial ! > my bed it on dhcp server config, as I cannot force someone to config > his server in a different way, I cannot use nslookup. Different DHCP server config shall not give different nslookup output if device is configured for same IP address. So there is usually something wrong. I think

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Ralf Friedl
Eial Czerwacki wrote: On 07/08/2012 01:27 PM, Ralf Friedl wrote: Looking at the source busybox-1.19.2/networking/nslookup.c it's simply not possible that the output of system 1 comes from busybox 1.19.2. but still I do see two distinct outputs on the same busybox. Please verify that it

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread ra...@gmx.de
Hi Ralf ! > By the way, the applet nslookup is misleading, because it uses > getaddrinfo instead of a DNS query. As a consequence, there are even > answers from non existing DNS-servers. Whops ... so Busybox nslookup does the job of 'getent hosts' (or one of its alikes) ... and not a separate D

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Eial Czerwacki
Harald, On 07/08/2012 01:33 PM, ra...@gmx.de wrote: > It was Laurent who mentioned dnsip. You mixed only things and I tried > to clarify this. indeed but I don't think that is it relevant anymore. > ping is not a candidate to just query an IP address. Completely > different purpose -> don't use

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Eial Czerwacki
Ralf, On 07/08/2012 01:27 PM, Ralf Friedl wrote: > Looking at the source busybox-1.19.2/networking/nslookup.c it's simply > not possible that the output of system 1 comes from busybox 1.19.2. > but still I do see two distinct outputs on the same busybox. > By the way, the applet nslookup is mi

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread ra...@gmx.de
Hi Eial ! > we've agreed in an off list mail thread that getent is the right > course of action here, why does dnsip should change it? It was Laurent who mentioned dnsip. You mixed only things and I tried to clarify this. > I still fail to see the issue, why this is different then previously > d

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Ralf Friedl
Eial Czerwacki wrote: system 1: nslookup skynet Server: 10.200.10.20 Address:10.200.10.20#53 Name: skynet Address: 10.200.10.20 system 2: nslookup skynet Server:10.200.10.20 Address 1: 10.200.10.20 skynet Name: skynet Address 1: 10.200.10.20 skynet both use the s

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Eial Czerwacki
Harald, On 07/08/2012 12:34 PM, ra...@gmx.de wrote: > It looks to me, you still mix up some information. Here we talked about > a DNS query program (e.g. host or dnsip) and now you are asking about > the libc function getaddrinfo. I'm not sure if I understand, what are > you asking? > > getaddri

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread ra...@gmx.de
Hi Eial ! > I thought we've finished the getent vs host discussion. > > dnsip is an example of a full DNS query program like the host > > command from bind. My explanation decision was more general, not > > specific to an implementation. > doesn't getaddrinfo provides that? It looks to me, you s

Re: [PATCH] new applet gethostbyname

2012-07-08 Thread Eial Czerwacki
Harald, On 07/08/2012 09:24 AM, ra...@gmx.de wrote: > Thats what we are talking about ! > > On one hand, simple IP lookup using libc function (gethostbyname), on > the other hand, full DNS query (like host command). I thought we've finished the getent vs host discussion. > dnsip is an example

Re: [PATCH] new applet gethostbyname

2012-07-07 Thread ra...@gmx.de
Hi Eial ! > > You are not right. It is not the same behavior! > what is the difference then? Thats what we are talking about ! On one hand, simple IP lookup using libc function (gethostbyname), on the other hand, full DNS query (like host command). > > You can find the IP address of a name wit

Re: [PATCH] new applet gethostbyname

2012-07-07 Thread Eial Czerwacki
Harald, > > You are not right. It is not the same behavior! > what is the difference then? > You can find the IP address of a name with less code, correct, but this > uses the libc implementation of the resolver and does not the same kind > of work a DNS client does. So the decision is first,

Re: [PATCH] new applet gethostbyname

2012-07-07 Thread Eial Czerwacki
On 07/05/2012 06:41 PM, Paul Smith wrote: > On Thu, 2012-07-05 at 17:13 +0300, Eial Czerwacki wrote: >> On 07/05/2012 02:03 PM, Laurent Bercot wrote: but these bins are large, my applet adds at most 3kb to the total size. >>> >>> My statically linked "dnsip" applet is 27 kB. This does not qu

Re: [PATCH] new applet gethostbyname

2012-07-05 Thread ra...@gmx.de
Hi Eial ! > for me it does, way to big when one can get the same behavior in a > fraction of the size. You are not right. It is not the same behavior! You can find the IP address of a name with less code, correct, but this uses the libc implementation of the resolver and does not the same kind o

Re: [PATCH] new applet gethostbyname

2012-07-05 Thread Paul Smith
On Thu, 2012-07-05 at 17:13 +0300, Eial Czerwacki wrote: > On 07/05/2012 02:03 PM, Laurent Bercot wrote: > >> but these bins are large, my applet adds at most 3kb to the total size. > > > > My statically linked "dnsip" applet is 27 kB. This does not qualify as > > "large" by any means on a full-f

Re: [PATCH] new applet gethostbyname

2012-07-05 Thread Eial Czerwacki
On 07/05/2012 02:03 PM, Laurent Bercot wrote: >> but these bins are large, my applet adds at most 3kb to the total size. > > My statically linked "dnsip" applet is 27 kB. This does not qualify as > "large" by any means on a full-fledged Unix platform (even an embedded one), > especially compared

Re: [PATCH] new applet gethostbyname

2012-07-05 Thread Laurent Bercot
> but these bins are large, my applet adds at most 3kb to the total size. My statically linked "dnsip" applet is 27 kB. This does not qualify as "large" by any means on a full-fledged Unix platform (even an embedded one), especially compared to the BIND "host" binary. You really have to figure

Re: [PATCH] new applet gethostbyname

2012-07-04 Thread Eial Czerwacki
On 07/04/2012 10:57 AM, Laurent Bercot wrote: > > You don't have to have *only* busybox on your embedded box. > Functionality that is not (yet) implemented in busybox can sometimes > be found elsewhere. > > You could download and compile djbdns ( http://cr.yp.to/djbdns.html ) > (you don't nee

Re: [PATCH] new applet gethostbyname

2012-07-04 Thread Laurent Bercot
> as said before, my needs are bound to getting the ip using dns as my usb > drive imaeg is "closed" in the matter that I don't want edit the hosts > file all the time. You don't have to have *only* busybox on your embedded box. Functionality that is not (yet) implemented in busybox can sometime

Re: [PATCH] new applet gethostbyname

2012-07-04 Thread Eial Czerwacki
On 07/04/2012 10:18 AM, Eial Czerwacki wrote: > On 07/04/2012 10:02 AM, Paul Smith wrote: > >> >> I don't understand what you mean. There's no need to add parsing >> for /etc/hosts to anything. The library already has that parsing code; >> it's all embedded under the gethostbyname() function.

Re: [PATCH] new applet gethostbyname

2012-07-04 Thread Eial Czerwacki
On 07/04/2012 10:02 AM, Paul Smith wrote: > > I don't understand what you mean. There's no need to add parsing > for /etc/hosts to anything. The library already has that parsing code; > it's all embedded under the gethostbyname() function. Since you're > already invoking gethostbyname() you're

Re: [PATCH] new applet gethostbyname

2012-07-04 Thread Paul Smith
On Wed, 2012-07-04 at 09:14 +0300, Eial Czerwacki wrote: > that is right but assuming /etc/hosts parsing is added, how can we be > sure that there isn't any changes in file format? I don't understand what you mean. There's no need to add parsing for /etc/hosts to anything. The library already ha

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Eial Czerwacki
Hello Harald, > If there will ever be a change in host file format the libc will honor > that change I ought. > > You do not need to add an extra parser for /etc/hosts. This parser is > part of the libc and usually there. And that is the difference: If you > want a simple interface to query an

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Eial Czerwacki
Hello Harald, > It does not depend on the output format, it depends on how you query > the IP address. The host command only queries the remote DNS server and > does NOT use local libc functions for name query. That is you directly > send network packets to DNS server and parse server responses.

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread ra...@gmx.de
Hi Eial ! > in that case I think that keeping it the host format is the right > thing to do. It does not depend on the output format, it depends on how you query the IP address. The host command only queries the remote DNS server and does NOT use local libc functions for name query. That is you d

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Eial Czerwacki
On 07/04/2012 09:00 AM, Paul Smith wrote: > On Wed, 2012-07-04 at 08:07 +0300, Eial Czerwacki wrote: > > I didn't see your implementation in detail, but if it uses > gethostbyname() or gethostent() etc. functions in GLIBC, then it IS NOT > the standard host(1) utility. > > The host(1) utility co

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread ra...@gmx.de
Hi Paul! > I'm not sure what you mean by emulated functions. Busybox emulates the functionality of the standard getent functions for passwd, shadow, group and gshadow files to bypass the usual need of nsswitch and it's need of extra libraries. This behavior of Busybox may be configured during bui

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Paul Smith
On Wed, 2012-07-04 at 08:07 +0300, Eial Czerwacki wrote: > does getent needs a valid host file in the system? > > after viewing both host and getent I'm sure that host is exactly what > I've implemented. I don't think it is a good idea to base the > implementation on getent. I didn't see your imp

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Eial Czerwacki
Hello Harald, > No ! > > In glibc gethostbyname (getaddrinfo is a different entry to same > functionality) uses the nsswitch and usually checks the local > addresses first (if not configured differently). Only the host command > from bind ignores local addresses. > > $ host NAME > --> only query

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread ra...@gmx.de
Hi Eial ! > so gethostbyname (or getaddrinfo as suggested by Baruch) doesn't > checks the local /etc/host first? No ! In glibc gethostbyname (getaddrinfo is a different entry to same functionality) uses the nsswitch and usually checks the local addresses first (if not configured differently). On

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Paul Smith
On Wed, 2012-07-04 at 04:08 +0200, ra...@gmx.de wrote: > Hi Paul! > > > IMHO we shouldn't be inventing new applets for busybox. > > ... > > Creating applets with no precedent in other UNIX/POSIX > > systems is (again IMHO) not a good idea for busybox. > > In principle you are right, but Busybox i

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Eial Czerwacki
Hello Harald, On 07/04/2012 08:34 AM, ra...@gmx.de wrote: > Hi Eial ! > >> does getent needs a valid host file in the system? > > First of all, an empty file is a valid host file. As a missing file is > usually assumed to equal an empty file, the host file doesn't need to > be there either. >

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread ra...@gmx.de
Hi Eial ! > does getent needs a valid host file in the system? First of all, an empty file is a valid host file. As a missing file is usually assumed to equal an empty file, the host file doesn't need to be there either. > after viewing both host and getent I'm sure that host is exactly what > I

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Eial Czerwacki
On 07/04/2012 05:08 AM, ra...@gmx.de wrote: > Hi Paul! > >> IMHO we shouldn't be inventing new applets for busybox. >> ... >> Creating applets with no precedent in other UNIX/POSIX >> systems is (again IMHO) not a good idea for busybox. > > In principle you are right, but Busybox is used on many

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread ra...@gmx.de
Hi Paul! > IMHO we shouldn't be inventing new applets for busybox. > ... > Creating applets with no precedent in other UNIX/POSIX > systems is (again IMHO) not a good idea for busybox. In principle you are right, but Busybox is used on many small systems where several higher functions are control

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Paul Smith
On Tue, 2012-07-03 at 11:36 -0400, Joshua Judson Rosen wrote: > On 2012-07-03 10:58, ra...@gmx.de wrote: > >>> So it might be a good idea for Eial to model this new applet on > >>> glibc's "getent" command > > > >> I cannot find any reference to glibc's "getent" command, can you point > >> me to su

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Joshua Judson Rosen
On 2012-07-03 10:58, ra...@gmx.de wrote: So it might be a good idea for Eial to model this new applet on glibc's "getent" command I cannot find any reference to glibc's "getent" command, can you point me to such reference? What about this one? Is it the right one?? http://perkamon.alioth.deb

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread walter harms
Am 03.07.2012 16:48, schrieb Eial Czerwacki: > On 07/03/2012 05:39 PM, Joshua Judson Rosen wrote: > >> On 2012-07-03 05:11, Baruch Siach wrote: >>> Hi Eial, >>> >>> On Tue, Jul 03, 2012 at 10:57:50AM +0300, Eial Czerwacki wrote: I'd like to propose a new applet, gethostbyname. all this

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Joshua Judson Rosen
On 2012-07-03 05:11, Baruch Siach wrote: Hi Eial, On Tue, Jul 03, 2012 at 10:57:50AM +0300, Eial Czerwacki wrote: I'd like to propose a new applet, gethostbyname. all this applet does is to get a host name and return the first ip address. IMHO, this applet should be called 'host', just like t

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread ra...@gmx.de
> > So it might be a good idea for Eial to model this new applet on > > glibc's "getent" command > I cannot find any reference to glibc's "getent" command, can you point > me to such reference? What about this one? Is it the right one?? http://perkamon.alioth.debian.org/online/man1/getent.1.php _

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Eial Czerwacki
On 07/03/2012 05:39 PM, Joshua Judson Rosen wrote: > On 2012-07-03 05:11, Baruch Siach wrote: >> Hi Eial, >> >> On Tue, Jul 03, 2012 at 10:57:50AM +0300, Eial Czerwacki wrote: >>> I'd like to propose a new applet, gethostbyname. >>> all this applet does is to get a host name and return the first i

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Eial Czerwacki
Hello Baruch, On 07/03/2012 12:11 PM, Baruch Siach wrote: > Hi Eial, > > On Tue, Jul 03, 2012 at 10:57:50AM +0300, Eial Czerwacki wrote: >> I'd like to propose a new applet, gethostbyname. >> all this applet does is to get a host name and return the first ip address. > > IMHO, this applet shoul

Re: [PATCH] new applet gethostbyname

2012-07-03 Thread Baruch Siach
Hi Eial, On Tue, Jul 03, 2012 at 10:57:50AM +0300, Eial Czerwacki wrote: > I'd like to propose a new applet, gethostbyname. > all this applet does is to get a host name and return the first ip address. IMHO, this applet should be called 'host', just like the similarly named BIND utility. [snip]

[PATCH] new applet gethostbyname

2012-07-03 Thread Eial Czerwacki
Hello All, I'd like to propose a new applet, gethostbyname. all this applet does is to get a host name and return the first ip address. the reason for this applet is that I have a embedded boot image build with busybox what queries me on boot for a hostname and runs a bin which tries to connect t