[Nut-upsdev] 2.8.1 build buglet: sockdebug.c

Jim Klimov jimklimov+nut at gmail.com
Thu Nov 9 15:49:36 GMT 2023


Thanks for the details.

I guess your `ld` is more pedantic than most :)

Looking at it cursorily, indeed `server/Makefile.am` optionally adds
libwrap details to default `AM_CFLAGS` and `LDADD` so `sockdebug` also gets
it in the command line. Probably a cleaner fix would be to patch this into
`upsd` build parameters specifically.

My understanding is that linkers then look for objects (in libs) according
to what is actually used - so if `sockdebug` does not make use of codepaths
that invoke libwrap, it is essentially ignored (a SO dependency may get
written, and lack of the binary would block the program from starting, but
that's about it). If so, this can explain why no other system complained
about the lack of exported ints from `sockdebug.o`...

Jim


On Thu, Nov 9, 2023 at 4:30 PM Greg Troxel <gdt at lexort.com> wrote:

> Jim Klimov <jimklimov+nut at gmail.com> writes:
>
> > By the way, on the NUT CI farm the libwrap is present on some (though not
> > all) systems - covering linux, freebsd, openindiana... and neither
> > complained about `sockdebug` :\
> >
> > What version do you have? Maybe it is some alternate implementation?
>
> Looks like 7.4, as amended in NetBSD over the years.   Looks like the
> original.  tcpd.h has
>
>  /*
>   * @(#) tcpd.h 1.5 96/03/19 16:22:24
>   *
>   * Author: Wietse Venema, Eindhoven University of Technology, The
> Netherlands.
>   */
>
>
> $ nm -g /usr/lib/libwrap.so|egrep _severity
>                  U allow_severity
>                  U deny_severity
>
> The man page says
>
>        The allow_severity and deny_severity variables determine how
> accepted
>        and rejected requests may be logged.  They must be provided by the
>        caller and may be modified by rules in the access control tables.
>
> and indeed see lines 68/89 of server/upsd.c which does exactly that.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/nut-upsdev/attachments/20231109/5766c8f4/attachment.htm>


More information about the Nut-upsdev mailing list