--- nss-mdns-0.10.orig/debian/docs +++ nss-mdns-0.10/debian/docs @@ -0,0 +1,2 @@ +doc/style.css +doc/README.html --- nss-mdns-0.10.orig/debian/NOTES.Debian +++ nss-mdns-0.10/debian/NOTES.Debian @@ -0,0 +1,93 @@ +Upgrade implementation notes +============================ + +The first version in Debian was 0.3-2. + +Postinst +======== + +Starting with version 0.8-4.2 inclusive, the package started touching +/etc/nsswitch.conf in debian/postinst. + +In versions 0.8-4.2, for first installs and upgrades from versions lower or +equal to 0.8-4.1, the postinst would: +- avoid doing anything if any of "mdns4_minimal", "mdns4", "mdns", + "mdns_minimal", "mdns6", "mdns6_minimal" was found in the hosts line; that + is, manually configured /etc/nsswitch.conf were kept intact +- otherwise change the "dns" entry in /etc/hosts into: + "mdns4_minimal [NOTFOUND=return] dns mdns4" + +Problems with this version: +1) does not preserve spacing ("foo bar" becomes "foo bar") +2) breaks local reaction overrides ("[STATUS=ACTION]") + +In version 0.8-5, the postinst is identical to the postinst of version 0.8-4.2. + +In version 0.8-6, the postinst was really messed up: +* for first installs: + - avoid doing anything if any of "mdns4_minimal", "mdns4", "mdns", + "mdns_minimal", "mdns6", "mdns6_minimal" was found in the hosts line; that + is, manually configured /etc/nsswitch.conf were kept intact + - otherwise change the "dns" entry in /etc/hosts into: + "mdns_minimal dns mdns" + - if the hosts line contained "... mdns4_minimal [NOTFOUND=return] ... dns + ... mdns4 ...", remove these "mdns4_minimal [NOTFOUND=return]" and "mdns4" + entries +* for upgrades from versions lower or equal to 0.8-4.1: + - avoid doing anything if any of "mdns4_minimal", "mdns4", "mdns", + "mdns_minimal", "mdns6", "mdns6_minimal" was found in the hosts line; that + is, manually configured /etc/nsswitch.conf were kept intact + - otherwise change the "dns" entry in /etc/hosts into: + "mdns_minimal dns mdns" +* for upgrades from versions 0.8-4.2 and 0.8-5: + - if the hosts line contained "... mdns4_minimal [NOTFOUND=return] ... dns + ... mdns4 ...", remove these "mdns4_minimal [NOTFOUND=return]" and "mdns4" + entries +* for upgrades from versions higher or equal to 0.8-6 (i.e. reinstalls of + 0.8-6!): + - avoid doing anything if any of "mdns4_minimal", "mdns4", "mdns", + "mdns_minimal", "mdns6", "mdns6_minimal" was found in the hosts line; that + is, manually configured /etc/nsswitch.conf were kept intact + - otherwise change the "dns" entry in /etc/hosts into: + "mdns_minimal dns mdns" + +Problems with this version: +1) does not preserve spacing ("foo bar" becomes "foo bar") in many cases +2) breaks local reaction overrides ("[STATUS=ACTION]") in many cases +3) does not handle all versions (e.g. local versions, versions from Ubuntu) +4) installs a configuration which does not match the upstream recommendations + for new installs or upgrades from >= 0.8-4.1 +5) removes any local or automatic configuration and breaks the mdns setup when + upgrading from versions 0.8-4.2 and 0.8-5 +6) results in ugly spacing when upgrading from versions 0.8-4.2 and 0.8-5 (note + the trailing space and the double space between files and dns): + hosts: files dns + +In version 0.8-6.1 and later, the postinst would: +- if upgrading from 0.8-6: + - revert breakage introduced in 0.8-6 + - avoid doing anything if any of "mdns4_minimal", "mdns4", "mdns", + "mdns_minimal", "mdns6", "mdns6_minimal" was found in the hosts line; that + is, manually configured /etc/nsswitch.conf were kept intact + - otherwise change the "dns" entry in /etc/hosts into: + "mdns4_minimal [NOTFOUND=return] dns mdns4" +- for first installs and upgrades from versions lower than + 0.8-4.2, the postinst would: + - avoid doing anything if any of "mdns4_minimal", "mdns4", "mdns", + "mdns_minimal", "mdns6", "mdns6_minimal" was found in the hosts line; that + is, manually configured /etc/nsswitch.conf were kept intact + - otherwise change the "dns" entry in /etc/hosts into: + "mdns4_minimal [NOTFOUND=return] dns mdns4" + + +Postrm +====== + +Concerning postrm, one was introduced in version 0.8-4.2 to remove any +keyword from a set of mdns keywords from the "hosts:" line of nsswitch.conf +during purge. This postinst snippet was dropped in 0.8-6. + +In version 0.9-0.1, the same snippet was reintroduced, but is run on package +removal instead of purge to ensure perl is still present and to avoid DNS +issues in case of a removed package. + --- nss-mdns-0.10.orig/debian/control +++ nss-mdns-0.10/debian/control @@ -0,0 +1,19 @@ +Source: nss-mdns +Section: admin +Priority: optional +Maintainer: Ubuntu Core developers +XSBC-Original-Maintainer: Anand Kumria +Build-Depends: debhelper (>> 4.0.0), lynx +Standards-Version: 3.7.2 + +Package: libnss-mdns +Section: admin +Depends: ${shlibs:Depends}, base-files (>= 3.1.10), perl, avahi-daemon (>= 0.6.16-1) +Suggests: avahi-autoipd | zeroconf +Architecture: any +Description: NSS module for Multicast DNS name resolution + nss-mdns is a plugin for the GNU Name Service Switch (NSS) functionality + of the GNU C Library (glibc) providing host name resolution via Multicast + DNS (using Zeroconf, aka Apple Bonjour / Apple Rendezvous ), effectively + allowing name resolution by common Unix/Linux programs in the ad-hoc mDNS + domain .local. --- nss-mdns-0.10.orig/debian/rules +++ nss-mdns-0.10/debian/rules @@ -0,0 +1,101 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + +CFLAGS = -Wall -g -DNDEBUG=1 + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +config.status: configure + dh_testdir + # Add here commands to configure the package. + ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/ --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/etc --localstatedir=/var --libexecdir=/lib/nss-mdns CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" --disable-legacy + + +build: build-stamp + +build-stamp: config.status + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/nss-mdns.sgml > nss-mdns.1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) distclean + + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/nss-mdns. + $(MAKE) install DESTDIR=$(CURDIR)/debian/libnss-mdns + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- nss-mdns-0.10.orig/debian/changelog +++ nss-mdns-0.10/debian/changelog @@ -0,0 +1,287 @@ +nss-mdns (0.10-0.1ubuntu1) gutsy; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/postinst: Automatically transition the dapper default hosts: line + 'files dns mdns' to the recommended value, since dns before mdns is + inefficient, a DNS server DoS, and an information leak. This needs to be + kept until the next LTS release. + + -- Martin Pitt Tue, 15 May 2007 16:27:20 +0200 + +nss-mdns (0.10-0.1) unstable; urgency=high + + * NMU + * New upstream release + * Fixes alignment problems on sparc causing sigBUS (Closes: #423222) + + -- Sjoerd Simons Sun, 13 May 2007 10:23:16 +0200 + +nss-mdns (0.9-0.2ubuntu1) feisty; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/postinst: Automatically transition the dapper default hosts: line + 'files dns mdns' to the recommended value, since dns before mdns is + inefficient, a DNS server DoS, and an information leak. + * Now ships libraries in /lib, not /usr/lib. (LP: #87207) + * Reapply debian/patches/00_dns_unaligned_access.patch; debian/rules does + not do this, and this got dropped in an earlier merge. + * debian/control: Set Ubuntu maintainer. + + -- Martin Pitt Tue, 27 Feb 2007 16:54:20 +0100 + +nss-mdns (0.9-0.2) unstable; urgency=high + + * Non-maintainer upload to fix a RC bug. + * Configure with a prefix of / instead of /usr as libnss-mdns needs to be in + /lib for the resolver to work correctly during boot; this is also needed + for chrooted processes such as Postfix's smtpd which uses a copy of the + NSS libs as well of the NSS configuration and fails when mdns is missing + in the chroot but referenced in nsswitch.conf. Update other configured + dirs (mandir, infodir, sysconfdir) as well, but these are currently not + used. + + -- Loic Minier Thu, 22 Feb 2007 14:48:45 +0100 + +nss-mdns (0.9-0.1) unstable; urgency=high + + * Non-maintainer upload to fix broken dependencies in the 0.8-6.1 NMU. + * Fix Depends on perl and avahi-daemon. + * Bump up dependency on avahi-daemon to >= 0.6.16-1 for the auto-disabling + functionality on sites with a .local SOA. + * New upstream release. + - Does not export unnecessary symbols and fixes segfault in nmbclient + which had symbols with the same name; closes: #404266. + - Does not use the "search" keyword of resolv.conf anymore; + closes: #404534, #405327. + * Re-add a postrm to cleanup the mdns_* entries from nsswitch.conf but act on + package removal instead of purge to avoid breaking the DNS when the lib is + removed and to ensure perl is still present; closes: #406198. + * Document the changes made to postinst in NOTES.Debian and document the + history of the postrm as well. + * Updates to README.Debian; add upstream URL for troubleshooting. + + -- Loic Minier Tue, 9 Jan 2007 18:45:27 +0100 + +nss-mdns (0.9-0ubuntu1) feisty; urgency=low + + * New upstream bugfix release: + - Make most shared library symbols private to not conflict with any + symbols of the program we're loaded into. + - Fix a potential endless loop in the mDNS packet parsing code. + - Do not build legacy internal DNS stack by default any more. + - Do not honour /etc/resolv.conf domain search lists by default anymore. + It created a lot of problems and was never recommended anyway. + + -- Martin Pitt Tue, 2 Jan 2007 12:45:26 +0100 + +nss-mdns (0.8-6.1ubuntu1) feisty; urgency=low + + * Merge from Debian unstable; remaining Ubuntu changes: + - debian/postinst: Automatically transition the dapper default hosts: line + 'files dns mdns' to the recommended value, since dns before mdns is + inefficient, a DNS server DoS, and an information leak. + + -- Martin Pitt Tue, 2 Jan 2007 12:20:57 +0100 + +nss-mdns (0.8-6.1) unstable; urgency=low + + * Non-maintainer upload to fix a long-standing RC bug and to beat the + package into shape before etch with suggestions from upstream; thanks + Lennart Poettering. + * Configure with --disable-legacy, as recommended by upstream for security + reasons; the legacy mode might be offered in a separate binary package for + the corner cases where it can be useful; see full discussion in #393711; + depend on avahi-daemon as nss-mdns will not work without avahi when + compiled like this; closes: #399297. + * Only suggest zeroconf instead of Recommending it: even if it can act as a + nice complement to nss-mdns, it is intrusive and orthogonal to nss-mdns + and conflicts with avahi-autoipd; closes: #353131, #392590. + * Suggest avahi-autoipd as an alternative to zeroconf. + * Remove offensive comments in postinst and README.Debian. + * Document the history of postinst snippets in debian/NOTES.Debian to permit + handling all upgrade paths. + * Depend on Perl for the postinst snippets using the perl interpreter. + * Rewrite postinst to handle all upgrade paths. + - Does not wipe NSS configuration which matches the upstream recommended + configuration during upgrades from versions 0.8-4.2 or 0.8-5; + closes: #393608. + - Install the upstream recommended configuration for first installs and + upgrades from versions which did not automatically insert mdns in the + NSS setup (unless mdns is already setup); closes: #393711. + - Keep configuration intact when upgrading from versions which installed + the upstream recommended configuration. + - Remove whitespaces added in upgrades from version 0.8-4.2 or 0.8-5 to + 0.8-6. + - For upgrades from 0.8-6, attempt to revert the problematic "mdns_minimal + dns mdns" configuration and to install the upstream recommended + configuration. + * Update README.Debian to match the above changes and a planned changes in + avahi-daemon which should disable itself if a .local SOA is found after a + change in the DNS settings. + + -- Loic Minier Sun, 24 Dec 2006 20:27:30 +0100 + +nss-mdns (0.8-6ubuntu2) feisty; urgency=low + + * debian/postinst: Automatically transition the dapper default hosts: line + 'files dns mdns' to the recommended value, since dns before mdns is + inefficient, a DNS server DoS, and an information leak. (This is not done + by the previous transition in postinst, since that leaves nsswitch.conf + alone if it mentions mdns at all). + + -- Martin Pitt Wed, 29 Nov 2006 13:52:48 +0100 + +nss-mdns (0.8-6ubuntu1) feisty; urgency=low + + * Merge with Debian, but base Feisty package on 0.8-5; -6 reverts all the + fixes that were applied in -4.2 and -5 and ships a broken nssswitch.conf + (see Debian bug #393711). We will handle existing .local domains + differently (see https://wiki.ubuntu.com/ZeroConfNetworking) + * debian/rules: Build -with --disable-legacy to avoid problems with internal + DNS stack. Always use Avahi for .local name resolution. + + -- Martin Pitt Fri, 24 Nov 2006 15:43:50 +0100 + +nss-mdns (0.8-6) unstable; urgency=medium + + * Revert hostile package takeover. + * "Unbreak the world" (Closes: #392813) + + "So whether nss-mdns does or doesn't support "search local" is of no + concern to me -- I just doesn't want it to interfere with my otherwise + working setup." + + Walter Hofmann on Joey Hess and Sjoerd Simons' period of maintainence + + * Revert switch to CDBS. + * Switch to using a sane /etc/nsswitch.conf + so we don't break existing setups, or those over which the user has + no control. + * Revert "clarifications" as well. + * Recommend, once again, zeroconf. + + -- Anand Kumria Mon, 16 Oct 2006 12:18:55 +1000 + +nss-mdns (0.8-5) unstable; urgency=low + + * Take over the package for the pkg-utopia team. T + * Acknowledge NMU's (Closes: #388864, #351990, #353131, #378608) + * Switch to cdbs. As a side-effect the sysconfdir and localstatedir are set + correctly (Closes: #387231) + * debian/patches/00_dns_unaligned_access.patch: + - Added. Prevent unaligned access when creating/parsing dns packets. + + -- Sjoerd Simons Wed, 11 Oct 2006 11:32:46 +0200 + +nss-mdns (0.8-4.2) unstable; urgency=low + + * NMU + * Add postinst that will add mdns entries to /etc/nsswitch.conf on new + installs and on upgrades from the previous version. Closes: #388864, + #351990 + * Add postrm to remove mdns entries from /etc/nsswitch.conf when the package + is removed. + * Local modifications to the file will be preserved accross upgrades. + * Depend on base-files 3.1.10 or higher to get a nsswitch.conf that is not a + conffile and that doesn't have mdns entries from base-files in it. + * Switch to nsswitch line recommended by upstream in #388864 after getting + clarification from upstream, and update README.Debian. + * Remove recommends on zeroconf. Closes: #353131 + + -- Joey Hess Fri, 22 Sep 2006 21:10:25 -0400 + +nss-mdns (0.8-4.1) unstable; urgency=low + + * NMU + * Clear out the diff.gz so it doesn't patch the various autotools files, + which makes everything explode on build (Closes: #378608) + + -- Sjoerd Simons Fri, 8 Sep 2006 09:51:57 +0200 + +nss-mdns (0.8-4) unstable; urgency=low + + * Forget about using CDBS and use debhelper directly so we have control of + what is being built and updated. (Closes: #378608) + + -- Anand Kumria Sun, 13 Aug 2006 12:24:32 +1000 + +nss-mdns (0.8-3) unstable; urgency=low + + * Regenerate the Debian .diff.gz so the Debian build system doesn't barf and + die + + -- Anand Kumria Sun, 13 Aug 2006 09:49:39 +1000 + +nss-mdns (0.8-2) unstable; urgency=low + + * Copy 'configure' from the upstream tarball since the CDBS regeneration has + gone awry and does not work. This is the simple fix -- a more robust one + will be in place shortly. Thanks to Sam Morris for the diagnosis. + (Closes: #378608) + + -- Anand Kumria Sun, 13 Aug 2006 09:40:48 +1000 + +nss-mdns (0.8-1) unstable; urgency=low + + * New upstream release (Closes: #369827) + * Enable "minimal" mDNS mode -- Debian has had this for a while but + upstream have now incorporated it. This should mean that mdns + can now be mentioned in /etc/nsswitch.conf without issue. + (Closes: #348578, #348580) + * Suggest avahi-daemon rather than nscd (Closes: #367275) + + -- Anand Kumria Mon, 3 Jul 2006 03:55:05 +1000 + +nss-mdns (0.7-1) unstable; urgency=low + + * New upstream release + + -- Anand Kumria Tue, 27 Dec 2005 06:42:42 +1100 + +nss-mdns (0.6-2) unstable; urgency=low + + * Enable Avahi connections + + -- Anand Kumria Mon, 12 Sep 2005 20:59:52 +1000 + +nss-mdns (0.6-1) unstable; urgency=low + + * New upstream release + + -- Anand Kumria Fri, 2 Sep 2005 03:58:34 +1000 + +nss-mdns (0.5-1) unstable; urgency=low + + * New upstream release (Closes: #313024) + + -- Anand Kumria Thu, 16 Jun 2005 17:38:13 +1000 + +nss-mdns (0.4-1) unstable; urgency=low + + * New upstream release + * Fix endian issues (Closes: #305465) + + -- Anand Kumria Mon, 16 May 2005 05:12:09 +1000 + +nss-mdns (0.3-2) unstable; urgency=low + + * Modify Maintainer to point to me. + * Recommend 'zeroconf' + * Remove i386 specific int3 debug hack. + * Update to standard 3.6.1 + * Reclose RFP (Closes: #284497) + + -- Anand Kumria Mon, 7 Mar 2005 01:27:04 +1100 + +nss-mdns (0.3-1) unstable; urgency=low + + * Update to current upstream + + -- Lennart Poettering Sun, 16 Jan 2005 14:57:28 +0100 + +nss-mdns (0.1-0) unstable; urgency=low + + * Initial Release (Closes: #284497). + + -- Jeff Waugh Tue, 07 Dec 2004 12:42:51 +0100 + --- nss-mdns-0.10.orig/debian/postinst +++ nss-mdns-0.10/debian/postinst @@ -0,0 +1,90 @@ +#!/bin/sh +set -e +#DEBHELPER# + +log() { + echo "$*" +} + +# try to insert mdns entries to the "hosts" line in /etc/nsswitch.conf to +# automatically enable nss-mdns support; do not change the configuration if the +# "hosts" line already references some mdns lookups +insert_mdns() { + log "Checking NSS setup..." + # abort if /etc/nsswitch.conf does not exist + if ! [ -e /etc/nsswitch.conf ]; then + log "Could not find /etc/nsswitch.conf." + return + fi + perl -i -pe ' + sub insert { + # this also splits on tab + my @bits=split(" ", shift); + # do not break configuration if the "hosts" line already references + # mdns + if (grep { $_ eq "mdns4_minimal" || $_ eq "mdns4" + || $_ eq "mdns" || $_ eq "mdns_minimal" + || $_ eq "mdns6" || $_ eq "mdns6_minimal"} @bits) { + return join " ", @bits; + } + # change "dns" into "mdns4_minimal [NOTFOUND=return] dns mdns4" + return join " ", map { + $_ eq "dns" ? ("mdns4_minimal","[NOTFOUND=return]",$_,"mdns4") : $_ + } @bits; + } + s/^(hosts:\s+)(.*)/$1.insert($2)/e; + ' /etc/nsswitch.conf +} + +action="$1" + +if [ configure = "$action" ]; then + if [ -z "$2" ]; then + log "First installation detected..." + # first install: setup the recommended configuration (unless + # nsswitch.conf already contains mdns entries) + insert_mdns + else + # upgrade + version="$2" + + if dpkg --compare-versions "$version" lt 0.8-4.2; then + log "Upgrade from unconfigured version detected." + # versions prior to 0.8-4.2 did not setup nss-mdns automatically, + # do it now + insert_mdns + elif dpkg --compare-versions "$version" lt 0.8-6; then + log "Already configured version detected, skipping NSS setup." + # versions 0.8-4.2 and 0.8-5 installed the same configuration as + # this postinst, so nothing needs to be done + : + elif dpkg --compare-versions "$version" lt 0.8-6.1; then + log "Upgrade from possibly broken version detected." + if [ -e /etc/nsswitch.conf ]; then + # version 0.8-6 broke the configuration in multiple ways: 1) + # for systems which were upgraded from 0.8-4.2 or 0.8-5 to + # 0.8-6, the hosts line will look like: + # hosts: files dns + # cleanup from this specially formatted line into the default + # one: + sed -i \ + 's/^hosts: files dns $/hosts: files dns/' \ + /etc/nsswitch.conf + # 2) for systems which re-installed 0.8-6 or installed 0.8-6 as the + # first version, the hosts line will look like: + # hosts: files mdns_minimal dns mdns + # cleanup from this specially formatted line into the default one: + sed -i -r \ + '/^hosts:/s/\/dns/' \ + /etc/nsswitch.conf + fi + + insert_mdns + fi + + # transition from Dapper, which had wrong default 'files dns mdns' + if dpkg --compare-versions "$2" le 0.8-6ubuntu2; then + perl -i -pe 's/^(hosts:\s*)files\s+dns\s+mdns\s*$/$1files mdns4_minimal [NOTFOUND=return] dns mdns4\n/' /etc/nsswitch.conf + fi + fi +fi --- nss-mdns-0.10.orig/debian/compat +++ nss-mdns-0.10/debian/compat @@ -0,0 +1 @@ +4 --- nss-mdns-0.10.orig/debian/README.Debian +++ nss-mdns-0.10/debian/README.Debian @@ -0,0 +1,30 @@ +Packages automagically modifies /etc/nsswitch.conf +-------------------------------------------------- + +Previously the base-files package shipped /etc/nsswitch.conf and specified: + + hosts: files dns mdns + +However, due to bug#351990, this is no longer the case. /etc/nsswitch.conf +is now generated post-installation. Upon installation of nss-mdns, if the +strings 'mdns', 'mdns_minimal', 'mdns4', 'mdns4_minimal', 'mdns6' or +'mdns6_minimal' appear on the hosts line, your /etc/nsswitch.conf file +will not be updated, otherwise it will updated to match the upstream +recommended configuration which usually looks like: + + hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 + + +Sites with a .local DNS zone +---------------------------- + +Making nss-mdns authoritative for .local breaks resolution on networks +where .local is a real domain name. To workaround this, avahi-daemon +should be restarted when the DNS settings change (for example via +resolvconf and dhclient hooks) and disable itself when a SOA for the +.local zone is found. This is not currently implemented at the time of +writing, but should soon be. + +See also this excellent summary on the upstream website: + + --- nss-mdns-0.10.orig/debian/postrm +++ nss-mdns-0.10/debian/postrm @@ -0,0 +1,43 @@ +#!/bin/sh +set -e +#DEBHELPER# + +log() { + echo "$*" +} + +remove_mdns() { + log "Checking NSS setup..." + # abort if /etc/nsswitch.conf does not exist + if ! [ -e /etc/nsswitch.conf ]; then + log "Could not find /etc/nsswitch.conf." + return + fi + perl -i -pe ' + my @remove=( + "mdns4_minimal [NOTFOUND=return]", + "mdns4_minimal", + "mdns4", + "mdns6_minimal [NOTFOUND=return]", + "mdns6_minimal", + "mdns6", + "mdns_minimal [NOTFOUND=return]", + "mdns_minimal", + "mdns", + ); + sub remove { + my $s=shift; + foreach my $bit (@remove) { + $s=~s/\s+\Q$bit\E//g; + } + return $s; + } + s/^(hosts:)(.*)/$1.remove($2)/e; + ' /etc/nsswitch.conf +} + +action="$1" + +if [ "$action" = remove ]; then + remove_mdns +fi --- nss-mdns-0.10.orig/debian/patches/00_dns_unaligned_access.patch +++ nss-mdns-0.10/debian/patches/00_dns_unaligned_access.patch @@ -0,0 +1,120 @@ +Index: src/dns.c +=================================================================== +--- src/dns.c (revision 102) ++++ src/dns.c (working copy) +@@ -32,6 +32,33 @@ + + #include "dns.h" + ++#define SET_16_P(data, value) \ ++ do { \ ++ uint16_t __value = value; \ ++ memcpy(data, &__value, sizeof(uint16_t)); \ ++ } while(0) ++ ++#define SET_16(data, idx, value) \ ++ SET_16_P(((uint8_t *)data) + idx * sizeof(uint16_t)/sizeof(uint8_t), value) ++ ++#define GET_16_P(data, value) \ ++ do { \ ++ uint8_t *__value = ((uint8_t *)&value); \ ++ memcpy(__value, data, sizeof(uint16_t)); \ ++ } while(0) ++ ++#define GET_16(data, idx, value) \ ++ GET_16_P(((uint8_t *)data) + idx * sizeof(uint16_t)/sizeof(uint8_t), value) ++ ++#define GET_32_P(data, value) \ ++ do { \ ++ uint8_t *__value = ((uint8_t *)&value); \ ++ memcpy(__value, data, sizeof(uint32_t)); \ ++ } while(0) ++ ++#define GET_32(data, idx, value) \ ++ GET_32_P(((uint8_t *)data) + idx * sizeof(uint32_t)/sizeof(uint8_t), value) ++ + struct dns_packet* dns_packet_new(void) { + struct dns_packet *p; + +@@ -51,15 +78,19 @@ + void dns_packet_set_field(struct dns_packet *p, unsigned idx, uint16_t v) { + assert(p); + assert(idx < 2*6); ++ + +- ((uint16_t*) p->data)[idx] = htons(v); ++ SET_16(p->data, idx, htons(v)); + } + + uint16_t dns_packet_get_field(struct dns_packet *p, unsigned idx) { + assert(p); + assert(idx < 2*6); ++ uint16_t r; + +- return ntohs(((uint16_t*) p->data)[idx]); ++ GET_16(p->data, idx, r); ++ ++ return ntohs(r); + } + + uint8_t* dns_packet_append_name(struct dns_packet *p, const char *name) { +@@ -102,7 +133,7 @@ + assert(p); + + d = dns_packet_extend(p, sizeof(uint16_t)); +- *((uint16_t*) d) = htons(v); ++ SET_16_P(d, htons(v)); + + return d; + } +@@ -120,7 +151,7 @@ + } + + uint8_t *dns_packet_append_name_compressed(struct dns_packet *p, const char *name, uint8_t *prev) { +- int16_t *d; ++ uint8_t *d; + signed long k; + assert(p); + +@@ -131,8 +162,8 @@ + if (k < 0 || k >= 0x4000 || (size_t) k >= p->size) + return dns_packet_append_name(p, name); + +- d = (int16_t*) dns_packet_extend(p, sizeof(uint16_t)); +- *d = htons((0xC000 | k)); ++ d = dns_packet_extend(p, sizeof(uint16_t)); ++ SET_16_P(d, htons((0xC000 | k))); + + return prev; + } +@@ -246,11 +277,13 @@ + + int dns_packet_consume_uint16(struct dns_packet *p, uint16_t *ret_v) { + assert(p && ret_v); ++ uint16_t r; + + if (p->rindex + sizeof(uint16_t) > p->size) + return -1; +- +- *ret_v = ntohs(*((uint16_t*) (p->data + p->rindex))); ++ ++ GET_16_P(p->data + p->rindex, r); ++ *ret_v = ntohs(r); + p->rindex += sizeof(uint16_t); + + return 0; +@@ -258,11 +291,13 @@ + + int dns_packet_consume_uint32(struct dns_packet *p, uint32_t *ret_v) { + assert(p && ret_v); ++ uint32_t r; + + if (p->rindex + sizeof(uint32_t) > p->size) + return -1; + +- *ret_v = ntohl(*((uint32_t*) (p->data + p->rindex))); ++ GET_32_P(p->data + p->rindex, r); ++ *ret_v = ntohl(r); + p->rindex += sizeof(uint32_t); + + return 0; --- nss-mdns-0.10.orig/debian/copyright +++ nss-mdns-0.10/debian/copyright @@ -0,0 +1,9 @@ +This package was debianized by Jeff Waugh on +Tue, 07 Dec 2004 12:45:24 +0100. + +It was downloaded from + +Copyright (C) 2004, Lennart Poettering + +On Debian systems, the complete text of the GNU Lesser General Public License +can be found in `/usr/share/common-licenses/LGPL'.