OpenPrinting / OpenPrinting/cups-browsed

Disable avahi causes build to fail

Open
#21 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
49
Forks
19
PR merge metrics
No merged PRs in 30d

Description

My only printer is an old epson inkject which is locally via usb.

According to configure, '--disable-avahi' allows builds without avahi.

** build details **
configure:

Environment settings:
CFLAGS: -g -O2 -Wall -std=gnu11 -D_GNU_SOURCE
CXXFLAGS: -Wall -D_GNU_SOURCE
LDFLAGS:
Build configuration:
cups-config: system
init directory:
cups dom socket: /run/cups/cups.sock
avahi: no
browsing: dnssd cups
local queue naming for remote CUPS queues: DNS-SD
keep generated queues during shutdown: no
update network interfaces after each found entry: yes
all ipp printer auto-setup: yes
only driverless auto-setup: no
only local auto-setup: no
werror: no

'make' then fails with:
gcc -DHAVE_CONFIG_H -I. -I/usr/include/cupsfilters -I/usr/include/ppd -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -pthread -g -O2 -Wall -std=gnu11 -D_GNU_SOURCE -MT daemon/cups_browsed-cups-browsed.o -MD -MP -MF daemon/.deps/cups_browsed-cups-browsed.Tpo -c -o daemon/cups_browsed-cups-browsed.o test -f 'daemon/cups-browsed.c' || echo './'daemon/cups-browsed.c
daemon/cups-browsed.c:405:3: error: unknown type name 'AvahiIfIndex'
405 | AvahiIfIndex interface;
| ^~~~~~~~~~~~
daemon/cups-browsed.c:406:3: error: unknown type name 'AvahiProtocol'
406 | AvahiProtocol protocol;
| ^~~~~~~~~~~~~
daemon/cups-browsed.c:411:9: error: unknown type name 'AvahiAddress'
411 | const AvahiAddress *address;
| ^~~~~~~~~~~~
(etc)

Expected behavior
Build succeeds without avahi.

System Information:

  • OS: LinuxFromScratch
  • Version 20221113

Additional context
Since I lack a networked printer, installing avahi would be an unnecessary vulnerability.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in daemon/cups-browsed.c around lines 405-411, where Avahi types are used, and review the configure output for the --disable-avahi build. Reproduce the failure with Avahi disabled and verify that make completes successfully without Avahi.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.