Add libutil_drop_AI_ADDRCONFIG.patch that allows running nmbd when
authorbubulle <bubulle@alioth.debian.org>
Thu, 31 May 2012 20:23:16 +0000 (20:23 +0000)
committerbubulle <bubulle@alioth.debian.org>
Thu, 31 May 2012 20:23:16 +0000 (20:23 +0000)
no network interfaces have been assigned an address, therefore
removing the need for an if-up script. Closes: #640668,#640508

git-svn-id: svn://svn.debian.org/svn/pkg-samba/trunk/samba@4110 fc4039ab-9d04-0410-8cac-899223bdd6b0

debian/changelog
debian/patches/libutil_drop_AI_ADDRCONFIG.patch [new file with mode: 0644]
debian/patches/series
debian/samba.if-up [deleted file]

index 4edaaa7f5b8ee59f9cf77636bdb21dd183216278..9a7a4e793a9d17def15df7c0dfb0bda2efeb5ea5 100644 (file)
@@ -1,4 +1,4 @@
-samba (2:3.6.5-4) UNRELEASED; urgency=low
+samba (2:3.6.5-5) UNRELEASED; urgency=low
 
   [ Christian Perrier ]
   * Make libpam-winbind depend on libnss-winbind.
@@ -16,7 +16,12 @@ samba (2:3.6.5-4) UNRELEASED; urgency=low
   [ Luk Claes ]
   * Ship wbclient.pc file in multiarch safe directory (Closes: #674215).
 
- -- Christian Perrier <bubulle@debian.org>  Fri, 18 May 2012 08:45:13 +0200
+  [ Sam Morris ]
+  * Add libutil_drop_AI_ADDRCONFIG.patch  that allows running nmbd when
+    no network interfaces have been assigned an address, therefore
+    removing the need for an if-up script. Closes: #640668,#640508
+
+ -- Christian Perrier <bubulle@debian.org>  Thu, 31 May 2012 22:20:18 +0200
 
 samba (2:3.6.5-3) unstable; urgency=low
 
diff --git a/debian/patches/libutil_drop_AI_ADDRCONFIG.patch b/debian/patches/libutil_drop_AI_ADDRCONFIG.patch
new file mode 100644 (file)
index 0000000..acc666e
--- /dev/null
@@ -0,0 +1,54 @@
+From 185cd4c79492a7de5988f9407d764cdb3a0e2e10 Mon Sep 17 00:00:00 2001\r
+From: Simo Sorce <idra@samba.org>\r
+Date: Wed, 11 May 2011 17:50:07 -0400\r
+Subject: [PATCH] libutil: use AI_ADDRCONFIG only when AI_NUMERIC is not defined\r
+\r
+This flag prevents startup w/o ip addresses assigned to any interface.\r
+If AI_NUMERIC is passed it should be safe to avoid it.\r
+\r
+Signed-off-by: Andreas Schneider <asn@samba.org>\r
+---\r
+ lib/util/util_net.c |   16 +++++++++++-----\r
+ 1 files changed, 11 insertions(+), 5 deletions(-)\r
+\r
+Index: samba/lib/util/util_net.c
+===================================================================
+--- samba.orig/lib/util/util_net.c
++++ samba/lib/util/util_net.c
+@@ -64,10 +64,9 @@
+                       ppres);
+       if (ret) {
+-              DEBUG(3,("interpret_string_addr_internal: getaddrinfo failed "
+-                      "for name %s [%s]\n",
+-                      str,
+-                      gai_strerror(ret) ));
++              DEBUG(3, ("interpret_string_addr_internal: "
++                        "getaddrinfo failed for name %s (flags %d) [%s]\n",
++                        str, flags, gai_strerror(ret)));
+               return false;
+       }
+       return true;
+@@ -88,6 +87,7 @@
+ #if defined(HAVE_IPV6)
+       char addr[INET6_ADDRSTRLEN];
+       unsigned int scope_id = 0;
++      int int_flags;
+       if (strchr_m(str, ':')) {
+               char *p = strchr_m(str, '%');
+@@ -108,7 +108,13 @@
+       zero_sockaddr(pss);
+-      if (!interpret_string_addr_internal(&res, str, flags|AI_ADDRCONFIG)) {
++      if (flags & AI_NUMERICHOST) {
++              int_flags = flags;
++      } else {
++              int_flags = flags|AI_ADDRCONFIG;
++      }
++
++      if (!interpret_string_addr_internal(&res, str, int_flags)) {
+               return false;
+       }
+       if (!res) {
index 315a0f58b4a772ffd4ae769b9589c3d827dad4cf..81238fd6d3d3125d9896e591e8672c54fa92bb65 100644 (file)
@@ -20,4 +20,5 @@ bug_604768_upstream_7826_drop-using-samba-link.patch
 bug_604768_upstream_7826_fix-WHATSNEW-link.patch
 waf-as-source.patch
 smbtorture-manpage.patch
+libutil_drop_AI_ADDRCONFIG.patch
 shadow_copy2_backport.patch
diff --git a/debian/samba.if-up b/debian/samba.if-up
deleted file mode 100644 (file)
index c2357f4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-# Try to bring nmbd up when an interface comes up, if smbd is already running.
-
-# Don't bother to do anything for lo.
-if [ "$IFACE" = lo ]; then
-       exit 0
-fi
-
-# Only run from ifup.
-if [ "$MODE" != start ]; then
-       exit 0
-fi
-
-# Samba only cares about inet and inet6. Get thee gone, strange people
-# still using ipx.
-case $ADDRFAM in
-       inet|inet6|NetworkManager)
-               ;;
-       *)
-               exit 0
-               ;;
-esac
-
-status=$(/etc/init.d/samba status)
-
-# Really only necessary to do anything if nmbd is not already running
-if echo "$status" | grep -q 'smbd is running' \
-   && ! echo "$status" | grep -q 'nmbd is running'
-then
-       /etc/init.d/samba start
-fi
-
-exit 0