-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.
[ 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
--- /dev/null
+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) {
+++ /dev/null
-#!/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