-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters