Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnssd.c: Enable service registration on loopback only #346

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 15, 2024

  1. dnssd.c: Enable service registration on loopback only

    In case users would like to prevent sharing services from printer
     applications to local network, restrict it to localhost and let CUPS
     do the sharing.
    
    This can be done by setting system hostname in PAPPL API - this prevents
    accessing the public addresses, but the service is still published
    on those public addresses.
    
    The PR does the following:
    
    - set/reset system hostname in `papplSystemAddListeners()` directly, not via API.
      It prevents changing machine' hostname.
    - dnssd function will check the hostname and if it is localhost or matching
      IP address, it will use loopback index,
    - in case of Avahi it passes NULL as hostname to let Avahi decide
      what hostname to use (in case of hostname conflicts - and Avahi forbids
      using localhost if it is not FQDN).
    
    The result is that if system hostname is set to localhost internally, the service is published
    on .local address, but resolved to loopback because CUPS uses DNS-SD names in URIs.
    
    PAPPL 2.x version requires CUPS PR OpenPrinting/cups#902
    to have it working.
    zdohnal committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    b1d529e View commit details
    Browse the repository at this point in the history