[PATCH] new applet gethostbyname

Paul Smith paul at mad-scientist.net
Wed Jul 4 05:47:34 UTC 2012


On Wed, 2012-07-04 at 04:08 +0200, ralda at 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 small systems
> where several higher functions are controlled by shell scripts. As
> those scripts need access to several kind of information it is a good
> idea to have small applets build into Busybox to retrieve this
> information and present it in a compatible and easy to use manor.

Sorry but I don't agree with this.  Busybox is not intended (IMHO) to be
that kind of "anything goes" swiss army knife where any command line
utility someone can dream up should be added.  It's intended to provide
POSIX-based implementations of existing standard tools plus minimal (in
size) enhancements, as well as bare-bones implementations of other
common Linux utilities.

Of course, I have no standing here since I don't work on the code.
That's just my opinion.

> As this the getent command seams to be a good idea to be included in
> Busybox. The command gives access to several kind of information which
> is mostly based on glibc nsswitch functionality but this function is
> emulated within Busybox in severals ways (passwd, shadow, group,
> gshadow etc.). Implementing this in Busybox in a way that uses libbb
> functionality is perfect for information retrieval in shell
> scripts without need to look for the method on how this information is
> made available by the system. This could help to avoid to deal with
> system specific purposes in shell scripts as they are solved on a
> central (and fast/compact) place in Busybox.

Yes, this is why I seconded the recommendation of it.

I'm not sure what you mean by emulated functions.  getent is not much
more than a command-line interface to the POSIX standard get*ent()
functions like getpwent(), gethostent(), etc.  They all handle
nsswitch.conf etc. for you: users don't need to mess with that.  On a
standard system getent just calls those functions and formats the output
(basically).  Perhaps there's something about the Busybox environment
which makes this less than ideal?



More information about the busybox mailing list