From: Michael R Sweet Date: Wed, 1 Nov 2017 20:20:56 +0000 (-0400) Subject: Use the DNS-SD hostname when registering shared printers (Issue #5071) X-Git-Tag: v2.3b1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5d2b23327fa78c4e4cf90b82ece232e0e7f4167;p=thirdparty%2Fcups.git Use the DNS-SD hostname when registering shared printers (Issue #5071) --- diff --git a/CHANGES.md b/CHANGES.md index 0c4031dd1f..065844416d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,8 @@ Changes in CUPS v2.3b1 - No longer support backslash, question mark, or quotes in printer names (Issue #4966) - Dropped RSS subscription management from the web interface (Issue #5012) +- Bonjour printer sharing now uses the DNS-SD hostname (or ServerName value if + none is defined) when registering shared printers on the network (Issue #5071) - The `lp` and `lpr` commands now provide better error messages when the default printer cannot be found (Issue #5096) - The `lpadmin` command now provides a better error message when an unsupported diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index 2308e05384..dba2b7f598 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -1,7 +1,7 @@ /* * Directory services routines for the CUPS scheduler. * - * Copyright 2007-2015 by Apple Inc. + * Copyright 2007-2017 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the @@ -1075,7 +1075,7 @@ dnssdRegisterInstance( *srv = DNSSDMaster; error = DNSServiceRegister(srv, kDNSServiceFlagsShareConnection, - 0, name, temp, NULL, NULL, htons(port), + 0, name, temp, NULL, DNSSDHostName, htons(port), txt ? TXTRecordGetLength(txt) : 0, txt ? TXTRecordGetBytesPtr(txt) : NULL, dnssdRegisterCallback, p); @@ -1090,7 +1090,7 @@ dnssdRegisterInstance( error = avahi_entry_group_add_service_strlst(*srv, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, - type, NULL, NULL, port, + type, NULL, DNSSDHostName, port, txt ? *txt : NULL); if (error) cupsdLogMessage(CUPSD_LOG_DEBUG, "DNS-SD service add for \"%s\" failed.", diff --git a/scheduler/dirsvc.h b/scheduler/dirsvc.h index 5b2d23e8f9..0cfcad9ea9 100644 --- a/scheduler/dirsvc.h +++ b/scheduler/dirsvc.h @@ -1,7 +1,7 @@ /* * Directory services definitions for the CUPS scheduler. * - * Copyright 2007-2012 by Apple Inc. + * Copyright 2007-2017 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the