Fix Bug 8152 - smbd crash in release_ip()
authorChristian Ambach <ambi@samba.org>
Thu, 19 May 2011 16:13:40 +0000 (18:13 +0200)
committerChristian Ambach <ambi@samba.org>
Thu, 19 May 2011 19:21:14 +0000 (21:21 +0200)
release_ip() needs the private_data, but it was never saved away
to feed it into release_ip() later

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Thu May 19 21:21:14 CEST 2011 on sn-devel-104

source3/lib/ctdbd_conn.c
source3/smbd/process.c

index d27186996e6eeeb84594365dcae61a7e78e21c66..f42290695a79ab3b2ca0552fa18435c094c42dfc 100644 (file)
@@ -1358,6 +1358,11 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
        }
 
        conn->release_ip_handler = release_ip_handler;
+       /*
+        * store the IP address of the server socket for later
+        * comparison in release_ip()
+        */
+       conn->release_ip_priv = private_data;
 
        /*
         * We want to be told about IP releases
index d58baeb930da66d5fa9eb6a12538bfde149e822d..5f9845cba05a4831a8dd240e1e6abb9b8eb74dea 100644 (file)
@@ -2358,6 +2358,9 @@ static void release_ip(const char *ip, void *priv)
                p = addr + 7;
        }
 
+       DEBUG(10, ("Got release IP message for %s, "
+                  "our address is %s\n", ip, p));
+
        if ((strcmp(p, ip) == 0) || ((p != addr) && strcmp(addr, ip) == 0)) {
                /* we can't afford to do a clean exit - that involves
                   database writes, which would potentially mean we