Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

martin
Tuesday, February 27th, 2007 at 3:55:49pm UTC 

  1. diff -u nss-mdns-0.9/debian/NOTES.Debian nss-mdns-0.9/debian/NOTES.Debian
  2. --- nss-mdns-0.9/debian/NOTES.Debian
  3. +++ nss-mdns-0.9/debian/NOTES.Debian
  4. @@ -3,6 +3,9 @@
  5.  
  6.  The first version in Debian was 0.3-2.
  7.  
  8. +Postinst
  9. +========
  10. +
  11.  Starting with version 0.8-4.2 inclusive, the package started touching
  12.  /etc/nsswitch.conf in debian/postinst.
  13.  
  14. @@ -62,0 +66,28 @@
  15. +In version 0.8-6.1 and later, the postinst would:
  16. +- if upgrading from 0.8-6:
  17. +  - revert breakage introduced in 0.8-6
  18. +  - avoid doing anything if any of "mdns4_minimal", "mdns4", "mdns",
  19. +    "mdns_minimal", "mdns6", "mdns6_minimal" was found in the hosts line; that
  20. +    is, manually configured /etc/nsswitch.conf were kept intact
  21. +  - otherwise change the "dns" entry in /etc/hosts into:
  22. +    "mdns4_minimal [NOTFOUND=return] dns mdns4"
  23. +- for first installs and upgrades from versions lower than
  24. 0.8-4.2, the postinst would:
  25. +  - avoid doing anything if any of "mdns4_minimal", "mdns4", "mdns",
  26. +    "mdns_minimal", "mdns6", "mdns6_minimal" was found in the hosts line; that
  27. +    is, manually configured /etc/nsswitch.conf were kept intact
  28. +  - otherwise change the "dns" entry in /etc/hosts into:
  29. +    "mdns4_minimal [NOTFOUND=return] dns mdns4"
  30. +
  31. +
  32. +Postrm
  33. +======
  34. +
  35. +Concerning postrm, one was introduced in version 0.8-4.2 to remove any
  36. +keyword from a set of mdns keywords from the "hosts:" line of nsswitch.conf
  37. +during purge.  This postinst snippet was dropped in 0.8-6.
  38. +
  39. +In version 0.9-0.1, the same snippet was reintroduced, but is run on package
  40. +removal instead of purge to ensure perl is still present and to avoid DNS
  41. +issues in case of a removed package.
  42. +
  43. diff -u nss-mdns-0.9/debian/control nss-mdns-0.9/debian/control
  44. --- nss-mdns-0.9/debian/control
  45. +++ nss-mdns-0.9/debian/control
  46. @@ -1,16 +1,16 @@
  47.  Source: nss-mdns
  48.  Section: admin
  49.  Priority: optional
  50. -Maintainer: Anand Kumria <[email protected]>
  51. +Maintainer: Ubuntu Core developers <[email protected]>
  52. +XSBC-Original-Maintainer: Anand Kumria <[email protected]>
  53.  Build-Depends: debhelper (>> 4.0.0), lynx
  54.  Standards-Version: 3.7.2
  55.  
  56.  Package: libnss-mdns
  57.  Section: admin
  58. -Depends: perl, avahi-daemon
  59. +Depends: ${shlibs:Depends}, base-files (>= 3.1.10), perl, avahi-daemon (>= 0.6.16-1)
  60.  Suggests: avahi-autoipd | zeroconf
  61.  Architecture: any
  62. -Depends: ${shlibs:Depends}, base-files (>= 3.1.10)
  63.  Description: NSS module for Multicast DNS name resolution
  64.   nss-mdns is a plugin for the GNU Name Service Switch (NSS) functionality
  65.   of the GNU C Library (glibc) providing host name resolution via Multicast
  66. diff -u nss-mdns-0.9/debian/rules nss-mdns-0.9/debian/rules
  67. --- nss-mdns-0.9/debian/rules
  68. +++ nss-mdns-0.9/debian/rules
  69. @@ -27,7 +27,7 @@
  70.  config.status: configure
  71.         dh_testdir
  72.         # Add here commands to configure the package.
  73. -       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libexecdir=\${prefix}/lib/nss-mdns CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" --disable-legacy
  74. +       ./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
  75.  
  76.  
  77.  build: build-stamp
  78. diff -u nss-mdns-0.9/debian/changelog nss-mdns-0.9/debian/changelog
  79. --- nss-mdns-0.9/debian/changelog
  80. +++ nss-mdns-0.9/debian/changelog
  81. @@ -1,3 +1,49 @@
  82. +nss-mdns (0.9-0.2ubuntu1) feisty; urgency=low
  83. +
  84. +  * Merge from debian unstable, remaining changes:
  85. +    - debian/postinst: Automatically transition the dapper default hosts: line
  86. +      'files dns mdns' to the recommended value, since dns before mdns is
  87. +      inefficient, a DNS server DoS, and an information leak.
  88. +  * Now ships libraries in /lib, not /usr/lib. (LP: #87207)
  89. +  * Reapply debian/patches/00_dns_unaligned_access.patch; debian/rules does
  90. +    not do this, and this got dropped in an earlier merge.
  91. +  * debian/control: Set Ubuntu maintainer.
  92. +
  93. + -- Martin Pitt <[email protected]>  Tue, 27 Feb 2007 16:54:20 +0100
  94. +
  95. +nss-mdns (0.9-0.2) unstable; urgency=high
  96. +
  97. +  * Non-maintainer upload to fix a RC bug.
  98. +  * Configure with a prefix of / instead of /usr as libnss-mdns needs to be in
  99. +    /lib for the resolver to work correctly during boot; this is also needed
  100. +    for chrooted processes such as Postfix's smtpd which uses a copy of the
  101. +    NSS libs as well of the NSS configuration and fails when mdns is missing
  102. +    in the chroot but referenced in nsswitch.conf.  Update other configured
  103. +    dirs (mandir, infodir, sysconfdir) as well, but these are currently not
  104. +    used.
  105. +
  106. + -- Loic Minier <[email protected]>  Thu, 22 Feb 2007 14:48:45 +0100
  107. +
  108. +nss-mdns (0.9-0.1) unstable; urgency=high
  109. +
  110. +  * Non-maintainer upload to fix broken dependencies in the 0.8-6.1 NMU.
  111. +  * Fix Depends on perl and avahi-daemon.
  112. +  * Bump up dependency on avahi-daemon to >= 0.6.16-1 for the auto-disabling
  113. +    functionality on sites with a .local SOA.
  114. +  * New upstream release.
  115. +    - Does not export unnecessary symbols and fixes segfault in nmbclient
  116. +      which had symbols with the same name; closes: #404266.
  117. +    - Does not use the "search" keyword of resolv.conf anymore;
  118. +      closes: #404534, #405327.
  119. +  * Re-add a postrm to cleanup the mdns_* entries from nsswitch.conf but act on
  120. +    package removal instead of purge to avoid breaking the DNS when the lib is
  121. +    removed and to ensure perl is still present; closes: #406198.
  122. +  * Document the changes made to postinst in NOTES.Debian and document the
  123. +    history of the postrm as well.
  124. +  * Updates to README.Debian; add upstream URL for troubleshooting.
  125. +
  126. + -- Loic Minier <[email protected]>  Tue,  9 Jan 2007 18:45:27 +0100
  127. +
  128.  nss-mdns (0.9-0ubuntu1) feisty; urgency=low
  129.  
  130.    * New upstream bugfix release:
  131. @@ -222,0 +269 @@
  132. +
  133. diff -u nss-mdns-0.9/debian/README.Debian nss-mdns-0.9/debian/README.Debian
  134. --- nss-mdns-0.9/debian/README.Debian
  135. +++ nss-mdns-0.9/debian/README.Debian
  136. @@ -1,5 +1,5 @@
  137. -MODIFYING /etc/nsswitch.conf
  138. -----------------------------
  139. +Packages automagically modifies /etc/nsswitch.conf
  140. +--------------------------------------------------
  141.  
  142.  Previously the base-files package shipped /etc/nsswitch.conf and specified:
  143.  
  144. @@ -14,11 +14,9 @@
  145.  
  146.      hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
  147.  
  148. -This is currently not removed on removal or purge of nss-mdns.
  149. -
  150.  
  151. -.local domains
  152. ---------------
  153. +Sites with a .local DNS zone
  154. +----------------------------
  155.  
  156.  Making nss-mdns authoritative for .local breaks resolution on networks
  157.  where .local is a real domain name.  To workaround this, avahi-daemon
  158. @@ -29,0 +28,3 @@
  159. +See also this excellent summary on the upstream website:
  160. +    <http://avahi.org/wiki/AvahiAndUnicastDotLocal>
  161. +
  162. only in patch2:
  163. unchanged:
  164. --- nss-mdns-0.9.orig/src/dns.c
  165. +++ nss-mdns-0.9/src/dns.c
  166. @@ -32,6 +32,33 @@
  167.  
  168.  #include "dns.h"
  169.  
  170. +#define SET_16_P(data, value)                              \
  171. +  do {                                                     \
  172. +    uint16_t __value = value;                              \
  173. +    memcpy(data, &__value, sizeof(uint16_t));              \
  174. } while(0)
  175. +
  176. +#define SET_16(data, idx, value)                         \
  177. +  SET_16_P(((uint8_t *)data) + idx * sizeof(uint16_t)/sizeof(uint8_t), value)
  178. +
  179. +#define GET_16_P(data, value)                   \
  180. +  do {                                          \
  181. +    uint8_t *__value = ((uint8_t *)&value);     \
  182. +    memcpy(__value, data, sizeof(uint16_t));    \
  183. } while(0)
  184. +   
  185. +#define GET_16(data, idx, value) \
  186. +  GET_16_P(((uint8_t *)data) + idx * sizeof(uint16_t)/sizeof(uint8_t), value)
  187. +
  188. +#define GET_32_P(data, value)                   \
  189. +  do {                                          \
  190. +    uint8_t *__value = ((uint8_t *)&value);     \
  191. +    memcpy(__value, data, sizeof(uint32_t));    \
  192. } while(0)
  193. +   
  194. +#define GET_32(data, idx, value) \
  195. +  GET_32_P(((uint8_t *)data) + idx * sizeof(uint32_t)/sizeof(uint8_t), value)
  196. +
  197.  struct dns_packet* dns_packet_new(void) {
  198.      struct dns_packet *p;
  199.  
  200. @@ -51,15 +78,19 @@
  201.  void dns_packet_set_field(struct dns_packet *p, unsigned idx, uint16_t v) {
  202.      assert(p);
  203.      assert(idx < 2*6);
  204. +
  205.      
  206. -    ((uint16_t*) p->data)[idx] = htons(v);
  207. +    SET_16(p->data, idx, htons(v));
  208.  }
  209.  
  210.  uint16_t dns_packet_get_field(struct dns_packet *p, unsigned idx) {
  211.      assert(p);
  212.      assert(idx < 2*6);
  213. +    uint16_t r;
  214. +
  215. +    GET_16(p->data, idx, r);
  216.  
  217. -    return ntohs(((uint16_t*) p->data)[idx]);
  218. +    return ntohs(r);
  219.  }
  220.  
  221.  uint8_t* dns_packet_append_name(struct dns_packet *p, const char *name) {
  222. @@ -102,7 +133,7 @@
  223.      assert(p);
  224.      
  225.      d = dns_packet_extend(p, sizeof(uint16_t));
  226. -    *((uint16_t*) d) = htons(v);
  227. +    SET_16_P(d, htons(v));
  228.      
  229.      return d;
  230.  }
  231. @@ -120,7 +151,7 @@
  232.  }
  233.  
  234.  uint8_t *dns_packet_append_name_compressed(struct dns_packet *p, const char *name, uint8_t *prev) {
  235. -    int16_t *d;
  236. +    uint8_t *d;
  237.      signed long k;
  238.      assert(p);
  239.  
  240. @@ -131,8 +162,8 @@
  241.      if (k < 0 || k >= 0x4000 || (size_t) k >= p->size)
  242.          return dns_packet_append_name(p, name);
  243.  
  244. -    d = (int16_t*) dns_packet_extend(p, sizeof(uint16_t));
  245. -    *d = htons((0xC000 | k));
  246. +    d = dns_packet_extend(p, sizeof(uint16_t));
  247. +    SET_16_P(d, htons((0xC000 | k)));
  248.      
  249.      return prev;
  250.  }
  251. @@ -256,11 +287,13 @@
  252.  
  253.  int dns_packet_consume_uint16(struct dns_packet *p, uint16_t *ret_v) {
  254.      assert(p && ret_v);
  255. +    uint16_t r;
  256.  
  257.      if (p->rindex + sizeof(uint16_t) > p->size)
  258.          return -1;
  259. -
  260. -    *ret_v = ntohs(*((uint16_t*) (p->data + p->rindex)));
  261. +   
  262. +    GET_16_P(p->data + p->rindex, r);
  263. +    *ret_v =  ntohs(r);
  264.      p->rindex += sizeof(uint16_t);
  265.  
  266.      return 0;
  267. @@ -268,11 +301,13 @@
  268.  
  269.  int dns_packet_consume_uint32(struct dns_packet *p, uint32_t *ret_v) {
  270.      assert(p && ret_v);
  271. +    uint32_t r;
  272.  
  273.      if (p->rindex + sizeof(uint32_t) > p->size)
  274.          return -1;
  275.  
  276. -    *ret_v = ntohl(*((uint32_t*) (p->data + p->rindex)));
  277. +    GET_32_P(p->data + p->rindex, r);
  278. +    *ret_v = ntohl(r);
  279.      p->rindex += sizeof(uint32_t);
  280.      
  281.      return 0;
  282. only in patch2:
  283. unchanged:
  284. --- nss-mdns-0.9.orig/debian/postrm
  285. +++ nss-mdns-0.9/debian/postrm
  286. @@ -0,0 +1,43 @@
  287. +#!/bin/sh
  288. +set -e
  289. +#DEBHELPER#
  290. +
  291. +log() {
  292. +    echo "$*"
  293. +}
  294. +
  295. +remove_mdns() {
  296. +    log "Checking NSS setup..."
  297. +    # abort if /etc/nsswitch.conf does not exist
  298. +    if ! [ -e /etc/nsswitch.conf ]; then
  299. +        log "Could not find /etc/nsswitch.conf."
  300. +        return
  301. +    fi
  302. +    perl -i -pe '
  303. +        my @remove=(
  304. +            "mdns4_minimal [NOTFOUND=return]",
  305. +            "mdns4_minimal",
  306. +            "mdns4",
  307. +            "mdns6_minimal [NOTFOUND=return]",
  308. +            "mdns6_minimal",
  309. +            "mdns6",
  310. +            "mdns_minimal [NOTFOUND=return]",
  311. +            "mdns_minimal",
  312. +            "mdns",
  313. +        );
  314. +        sub remove {
  315. +            my $s=shift;
  316. +            foreach my $bit (@remove) {
  317. +                $s=~s/\s+\Q$bit\E//g;
  318. +            }
  319. +            return $s;
  320. +        }
  321. +        s/^(hosts:)(.*)/$1.remove($2)/e;
  322. +    ' /etc/nsswitch.conf
  323. +}
  324. +
  325. +action="$1"
  326. +
  327. +if [ "$action" = remove ]; then
  328. +    remove_mdns
  329. +fi

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right