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

Greg Troxel
Thu, 09 Nov 2023 14:44:24 -0000

I am (belatedly) updating pkgsrc to 2.8.1 (+ bugfix).

(FWIW, I think a 2.8.1.1 or 2.8.2 immediately with the fix is in
order.
>From a packaging viewpoint, the effort to update for a release is about
3 minutes plus time to adapt anythhing that has changed.  So I'd much
rather have releases more often.)

In the pkgsrc build, nut finds tcp wrappers because they are part of the
base system.  That's generally ok.

  checking whether to enable libwrap (tcp-wrappers) support... yes


There is a program sockdebug.c in server:

  Making all in server
  `libparseconf.la' is up to date.
    CC       sockdebug.o
  `libcommon.la' is up to date.
    CC       upsd.o
    CC       user.o
    CC       conf.o
    CC       netssl.o
    CC       sstate.o
    CC       desc.o
    CC       netget.o
    CC       netmisc.o
    CC       netlist.o
    CC       netuser.o
    CC       netset.o
    CC       netinstcmd.o
    CCLD     sockdebug
  ld: /usr/lib/libwrap.so: undefined reference to `deny_severity'
  ld: /usr/lib/libwrap.so: undefined reference to `allow_severity'
  *** [sockdebug] Error code 1

as I understand it, the tcprappers interface requires those variables to
exist.  Nut does define them:

  work/nut-2.8.1/server/upsd.c:int        allow_severity = LOG_INFO;
  work/nut-2.8.1/server/upsd.c:int        deny_severity = LOG_WARNING;

but not in sockdebug.

In server/Makefile.am, tcpwrappers are added for all targets:

  if WITH_WRAP
     LDADD += $(LIBWRAP_LIBS)
  endif


I don't know if the right fix is

  define these in sockdebug.c

  change LDADD to be only for upsd

or something else.

I think I'm going to just patch out building sockdebug for now.  Or is
that supposed to be installed for user use?  (If so, it really should
have nut in the name.)