[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Thu Jan 4 12:46:02 UTC 2024


The branch, master has been updated
       via  16d802f9c1f script/autobuild.py: add some --private-libraries=ALL testing
       via  6da49582c21 wafsamba: fix the usage of --private-extension-exception
       via  f22df59b065 wscript: use opt.PRIVATE_EXTENSION_DEFAULT('private-samba')
       via  3ae5afa6ad0 script/autobuild.py: nonshared-test works now
       via  a80614fe309 third_party/*_wrapper: use SAMBA_LIBRARY(force_unversioned=True)
       via  533e5daf772 wafsamba: introduce SAMBA_LIBRARY(force_unversioned=False)
       via  318fd95d5ea s3:smbd multichannel: always refresh the network information
       via  62654f0aeb1 ctdb: add comments to "addip"/"delip" when CTDB_{CONTROL,EVENT,SRVID}_IPREALLOCATED happens
       via  589ebabc95e ctdb: let "moveip" end with CTDB_CONTROL_IPREALLOCATED to all connected nodes
       via  2c6b455bd76 ctdb: remove unused ctdb_message_disable_ip_check()
       via  cad1969b171 ctdb: let "moveip" also use disable_takeover_runs()
       via  b1d0d5d5142 ctdb: send a CTDB_SRVID_IPREALLOCATED message after CTDB_EVENT_IPREALLOCATED
      from  1134c4f3a63 s3:utils: Fix the auth function to print correct values to the user

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 16d802f9c1f61cebb3699942242fbd3717f0dc4e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 29 15:28:37 2023 +0000

    script/autobuild.py: add some --private-libraries=ALL testing
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15545
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bjacke at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Thu Jan  4 12:45:58 UTC 2024 on atb-devel-224

commit 6da49582c212aefe859c71688a2d7beb72125fa9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 29 10:05:18 2023 +0000

    wafsamba: fix the usage of --private-extension-exception
    
    It was completely unused...
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15545
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bjacke at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit f22df59b0655f9bb812c39734782b0ff3c71c954
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 29 10:04:59 2023 +0000

    wscript: use opt.PRIVATE_EXTENSION_DEFAULT('private-samba')
    
    The problem was that we used opt.PRIVATE_EXTENSION_DEFAULT('samba4') and
    libndr as private will become libndr-samba4 and that already exists as
    libndr-samba4 as we don't append the extension if it's already there.
    
    So meant with --private-libraries=ALL we hit the following problem:
    
    $ ./configure --private-libraries=ALL
    $ make smbd/smbd
    Waf: Leaving directory `/samba/bin/default'
    Task dependency cycle in "run_after" constraints:
    {task ...: cshlib dcerpc-samba4.empty.c.12.o,ndr_winbind_c.c.229.o -> libdcerpc-samba4.so}
    make: *** [Makefile:131: smbd/smbd] Error 1
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15545
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bjacke at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 3ae5afa6ad0421f479c5fe63ed692593eaed7078
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 29 15:27:38 2023 +0000

    script/autobuild.py: nonshared-test works now
    
    I guess the problem was related to wrapper libraries...
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15545
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bjacke at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit a80614fe3098be42f330a73c5af28e646a86a042
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 29 14:32:51 2023 +0000

    third_party/*_wrapper: use SAMBA_LIBRARY(force_unversioned=True)
    
    This prevents --private-libraries=ALL from creating unuseable
    wrapper libraries, as they can't work with symbol versioning.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15545
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bjacke at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 533e5daf772b38e21830251d779f083da7197058
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 29 14:32:02 2023 +0000

    wafsamba: introduce SAMBA_LIBRARY(force_unversioned=False)
    
    This can be used in order to avoid a library to be
    catched by --private-libraries=ALL.
    It is needed for our wrapper libraries.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15545
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bjacke at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 318fd95d5ea63724798592eb6b4eebaecfa0cbfb
Author: Jones Syue <jonessyue at qnap.com>
Date:   Thu Jan 4 09:42:15 2024 +0800

    s3:smbd multichannel: always refresh the network information
    
    To maintain SMB Multichannel, windows client might periodically query with
    FSCTL_QUERY_NETWORK_INTERFACE_INFO to get SMB server's network information,
    in my case windows server 2022 would do this every 10 minutes (600 seconds).
    
    Consider a scenario: the network information might have changed between
    these queries, some become link down, new interface is link up, network
    speed is changed, and etc. So far smbd might not aware of these changes and
    still report out-of-date network information to windows client, until we
    manually send a SIGHUP to smbd in order to trigger load_interfaces():
    smbd_sig_hup_handler() > reload_services () > load_interfaces()
    This might be a bit inconvenient because it is hard to decide when should
    we manually send a SIGHUP to smbd for refreshing network information.
    
    This patch adds load_interfaces() at fsctl_network_iface_info(), while smbd
    received FSCTL_QUERY_NETWORK_INTERFACE_INFO would go through this and refresh
    local_interfaces, then respond to client with up-to-date network information;
    also refresh num_ifaces to make sure interfaces count is consistent.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15547
    
    Signed-off-by: Jones Syue <jonessyue at qnap.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bjacke at samba.org>

commit 62654f0aeb1909129e87df061186509560859bed
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Nov 24 11:51:54 2023 +0100

    ctdb: add comments to "addip"/"delip" when CTDB_{CONTROL,EVENT,SRVID}_IPREALLOCATED happens
    
    "addip"/"delip" are different from "moveip" so they don't need to
    call ipreallocate() nor send_ipreallocated_control_to_nodes().
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 589ebabc95eef0c301a47696e82c0ac341027597
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Nov 24 10:53:44 2023 +0100

    ctdb: let "moveip" end with CTDB_CONTROL_IPREALLOCATED to all connected nodes
    
    This matches the behavior of takeover_send/recv() from
    ctdb_takeover_helper.c.
    
    It means we consistently call the ipreallocated event scripts
    and also send CTDB_SRVID_IPREALLOCATED after moving ips.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 2c6b455bd7656b4e43d1f4ea488f06cd7918586b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Nov 24 10:50:16 2023 +0100

    ctdb: remove unused ctdb_message_disable_ip_check()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit cad1969b171766a5264973e7bfb5f9f7295421b6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 23 13:57:28 2023 +0100

    ctdb: let "moveip" also use disable_takeover_runs()
    
    That makes the behavior more consistent compared to a takeover run
    started from the within ctdbd.
    
    The behavior is the same but ctdb_message_disable_ip_check() used
    a legacy code path and the next commits will also touch some
    of the moveip logic...
    
    The logic and comments are copied from control_reloadips().
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit b1d0d5d51422f377c2e989ea6dacb2aa5794082b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 23 15:04:09 2023 +0100

    ctdb: send a CTDB_SRVID_IPREALLOCATED message after CTDB_EVENT_IPREALLOCATED
    
    Event scripts run the "ipreallocated" hook in order to notice that some ip addresses
    in the cluster potentially changed.
    
    CTDB_SRVID_IPREALLOCATED gives C code a chance to get notified as well once the event
    scripts are finished.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_bundled.py |   3 +
 buildtools/wafsamba/wafsamba.py      |  16 ++++-
 ctdb/client/client_message_sync.c    |  21 -------
 ctdb/client/client_sync.h            |   5 --
 ctdb/protocol/protocol.h             |   3 +
 ctdb/protocol/protocol_debug.c       |   2 +
 ctdb/protocol/protocol_message.c     |   9 +++
 ctdb/server/ctdb_takeover.c          |   4 ++
 ctdb/tools/ctdb.c                    | 119 ++++++++++++++++++++++++++++++++---
 script/autobuild.py                  |  40 ++++++++++--
 source3/smbd/smb2_ioctl_network_fs.c |  12 +++-
 third_party/nss_wrapper/wscript      |   3 +-
 third_party/pam_wrapper/wscript      |   4 +-
 third_party/resolv_wrapper/wscript   |   3 +-
 third_party/socket_wrapper/wscript   |   3 +-
 third_party/uid_wrapper/wscript      |   3 +-
 wscript                              |   2 +-
 17 files changed, 204 insertions(+), 48 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 2300565b2e4..029be159b62 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -10,6 +10,9 @@ def PRIVATE_NAME(bld, name):
 
     extension = bld.env.PRIVATE_EXTENSION
 
+    if name in bld.env.PRIVATE_EXTENSION_EXCEPTION:
+        return name
+
     if extension and name.startswith('%s' % extension):
         return name
 
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 3d6bbb84f6d..e1c2877e630 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -134,6 +134,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                   require_builtin_deps=False,
                   provide_builtin_linking=False,
                   builtin_cflags='',
+                  force_unversioned=False,
                   allow_undefined_symbols=False,
                   allow_warnings=False,
                   enabled=True):
@@ -171,9 +172,20 @@ def SAMBA_LIBRARY(bld, libname, source,
         raise Errors.WafError("private library '%s' with orig_vscript_map must not have abi_match" %
                              libname)
 
+    if force_unversioned and private_library:
+        raise Errors.WafError("private library '%s': can't have force_unversioned=True" %
+                             libname)
+
+    if force_unversioned and realname is None:
+        raise Errors.WafError("library '%s': force_unversioned=True needs realname too" %
+                             libname)
+
     if LIB_MUST_BE_PRIVATE(bld, libname) and target_type not in ['PLUGIN']:
         private_library = True
 
+    if force_unversioned:
+        private_library = False
+
     if not enabled:
         SET_TARGET_TYPE(bld, libname, 'DISABLED')
         return
@@ -327,7 +339,9 @@ def SAMBA_LIBRARY(bld, libname, source,
 
     vscript = None
     if bld.env.HAVE_LD_VERSION_SCRIPT:
-        if private_library:
+        if force_unversioned:
+            version = None
+        elif private_library:
             version = bld.env.PRIVATE_VERSION
         elif vnum:
             version = "%s_%s" % (libname, vnum)
diff --git a/ctdb/client/client_message_sync.c b/ctdb/client/client_message_sync.c
index f4d244122a9..a23cd6cfd2a 100644
--- a/ctdb/client/client_message_sync.c
+++ b/ctdb/client/client_message_sync.c
@@ -174,24 +174,3 @@ int ctdb_message_disable_recoveries(TALLOC_CTX *mem_ctx,
 
 	return ret;
 }
-
-int ctdb_message_disable_ip_check(TALLOC_CTX *mem_ctx,
-				  struct tevent_context *ev,
-				  struct ctdb_client_context *client,
-				  int destnode, uint32_t timeout)
-{
-	struct ctdb_req_message message;
-	int ret;
-
-	message.srvid = CTDB_SRVID_DISABLE_IP_CHECK;
-	message.data.timeout = timeout;
-
-	ret = ctdb_client_message(mem_ctx, ev, client, destnode, &message);
-	if (ret != 0) {
-		DEBUG(DEBUG_ERR,
-		      ("Message DISABLE_IP_CHECK failed to node %u\n",
-		       destnode));
-	}
-
-	return ret;
-}
diff --git a/ctdb/client/client_sync.h b/ctdb/client/client_sync.h
index 5b0ff42e95d..618879e3216 100644
--- a/ctdb/client/client_sync.h
+++ b/ctdb/client/client_sync.h
@@ -518,9 +518,4 @@ int ctdb_message_disable_recoveries(TALLOC_CTX *mem_ctx,
 				    int destnode,
 				    struct ctdb_disable_message *disable);
 
-int ctdb_message_disable_ip_check(TALLOC_CTX *mem_ctx,
-				  struct tevent_context *ev,
-				  struct ctdb_client_context *client,
-				  int destnode, uint32_t timeout);
-
 #endif /* __CTDB_CLIENT_SYNC_H__ */
diff --git a/ctdb/protocol/protocol.h b/ctdb/protocol/protocol.h
index 3b66c403ab8..009a0df06af 100644
--- a/ctdb/protocol/protocol.h
+++ b/ctdb/protocol/protocol.h
@@ -140,6 +140,9 @@ struct ctdb_call {
 /* SRVID to inform clients that an IP address has been taken over */
 #define CTDB_SRVID_TAKE_IP 0xF301000000000000LL
 
+/* SRVID to inform clients that CTDB_EVENT_IPREALLOCATED finished */
+#define CTDB_SRVID_IPREALLOCATED 0xF302000000000000LL
+
 /* SRVID to inform recovery daemon of the node flags - OBSOLETE */
 #define CTDB_SRVID_SET_NODE_FLAGS 0xF400000000000000LL
 
diff --git a/ctdb/protocol/protocol_debug.c b/ctdb/protocol/protocol_debug.c
index ae091b04d32..f1e1fc070d9 100644
--- a/ctdb/protocol/protocol_debug.c
+++ b/ctdb/protocol/protocol_debug.c
@@ -301,6 +301,8 @@ static void ctdb_srvid_print(uint64_t srvid, FILE *fp)
 		fprintf(fp, "RELEASE_IP");
 	} else if (srvid == CTDB_SRVID_TAKE_IP) {
 		fprintf(fp, "TAKE_IP");
+	} else if (srvid == CTDB_SRVID_IPREALLOCATED) {
+		fprintf(fp, "IPREALLOCATED");
 	} else if (srvid == CTDB_SRVID_SET_NODE_FLAGS) {
 		fprintf(fp, "SET_NODE_FLAGS");
 	} else if (srvid == CTDB_SRVID_RECD_UPDATE_IP) {
diff --git a/ctdb/protocol/protocol_message.c b/ctdb/protocol/protocol_message.c
index e2202bb78d5..8d323227914 100644
--- a/ctdb/protocol/protocol_message.c
+++ b/ctdb/protocol/protocol_message.c
@@ -57,6 +57,9 @@ static size_t ctdb_message_data_len(union ctdb_message_data *mdata,
 		len = ctdb_string_len(&mdata->ipaddr);
 		break;
 
+	case CTDB_SRVID_IPREALLOCATED:
+		break;
+
 	case CTDB_SRVID_SET_NODE_FLAGS:
 		len = ctdb_node_flag_change_len(mdata->flag_change);
 		break;
@@ -148,6 +151,9 @@ static void ctdb_message_data_push(union ctdb_message_data *mdata,
 		ctdb_string_push(&mdata->ipaddr, buf, &np);
 		break;
 
+	case CTDB_SRVID_IPREALLOCATED:
+		break;
+
 	case CTDB_SRVID_SET_NODE_FLAGS:
 		ctdb_node_flag_change_push(mdata->flag_change, buf, &np);
 		break;
@@ -244,6 +250,9 @@ static int ctdb_message_data_pull(uint8_t *buf, size_t buflen,
 				       &np);
 		break;
 
+	case CTDB_SRVID_IPREALLOCATED:
+		break;
+
 	case CTDB_SRVID_SET_NODE_FLAGS:
 		ret = ctdb_node_flag_change_pull(buf, buflen, mem_ctx,
 						 &mdata->flag_change, &np);
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index e333105e633..b622fafd95f 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -2399,6 +2399,7 @@ static void ctdb_ipreallocated_callback(struct ctdb_context *ctdb,
 {
 	struct ipreallocated_callback_state *state =
 		talloc_get_type(p, struct ipreallocated_callback_state);
+	TDB_DATA data = { .dsize = 0, };
 
 	if (status != 0) {
 		DEBUG(DEBUG_ERR,
@@ -2409,6 +2410,9 @@ static void ctdb_ipreallocated_callback(struct ctdb_context *ctdb,
 		}
 	}
 
+	D_INFO("Sending IPREALLOCATED message\n");
+	ctdb_daemon_send_message(ctdb, ctdb->pnn, CTDB_SRVID_IPREALLOCATED, data);
+
 	ctdb_request_control_reply(ctdb, state->c, NULL, status, NULL);
 	talloc_free(state);
 }
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 67d2f6bc1c9..6e8185ff495 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -82,6 +82,16 @@ struct ctdb_context {
 
 static void usage(const char *command);
 
+static int disable_takeover_runs(TALLOC_CTX *mem_ctx,
+				 struct ctdb_context *ctdb,
+				 uint32_t timeout,
+				 uint32_t *pnn_list,
+				 int count);
+static int send_ipreallocated_control_to_nodes(TALLOC_CTX *mem_ctx,
+					       struct ctdb_context *ctdb,
+					       uint32_t *pnn_list,
+					       int count);
+
 /*
  * Utility Functions
  */
@@ -3846,14 +3856,8 @@ static int moveip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
 	uint32_t *pnn_list;
 	unsigned int i;
 	int ret, count;
-
-	ret = ctdb_message_disable_ip_check(mem_ctx, ctdb->ev, ctdb->client,
-					    CTDB_BROADCAST_CONNECTED,
-					    2*options.timelimit);
-	if (ret != 0) {
-		fprintf(stderr, "Failed to disable IP check\n");
-		return ret;
-	}
+	uint32_t *connected_pnn = NULL;
+	int connected_count;
 
 	ret = ctdb_ctrl_get_public_ips(mem_ctx, ctdb->ev, ctdb->client,
 				       pnn, TIMEOUT(), false, &pubip_list);
@@ -3886,6 +3890,34 @@ static int moveip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
 		return 1;
 	}
 
+	connected_count = list_of_connected_nodes(nodemap,
+						  CTDB_UNKNOWN_PNN,
+						  mem_ctx,
+						  &connected_pnn);
+	if (connected_count <= 0) {
+		fprintf(stderr, "Memory allocation error\n");
+		return 1;
+	}
+
+	/*
+	 * Disable takeover runs on all connected nodes.  A reply
+	 * indicating success is needed from each node so all nodes
+	 * will need to be active.
+	 *
+	 * A check could be added to not allow reloading of IPs when
+	 * there are disconnected nodes.  However, this should
+	 * probably be left up to the administrator.
+	 */
+	ret = disable_takeover_runs(mem_ctx,
+				    ctdb,
+				    2*options.timelimit,
+				    connected_pnn,
+				    connected_count);
+	if (ret != 0) {
+		fprintf(stderr, "Failed to disable takeover runs\n");
+		return ret;
+	}
+
 	pubip.pnn = pnn;
 	pubip.addr = *addr;
 	ctdb_req_control_release_ip(&request, &pubip);
@@ -3905,7 +3937,24 @@ static int moveip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
 		return ret;
 	}
 
-	return 0;
+	/*
+	 * It isn't strictly necessary to wait until takeover runs are
+	 * re-enabled but doing so can't hurt.
+	 */
+	ret = disable_takeover_runs(mem_ctx,
+				    ctdb,
+				    0,
+				    connected_pnn,
+				    connected_count);
+	if (ret != 0) {
+		fprintf(stderr, "Failed to enable takeover runs\n");
+		return ret;
+	}
+
+	return send_ipreallocated_control_to_nodes(mem_ctx,
+						   ctdb,
+						   connected_pnn,
+						   connected_count);
 }
 
 static int control_moveip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
@@ -4031,6 +4080,17 @@ static int control_addip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
 		return ret;
 	}
 
+	/*
+	 * CTDB_CONTROL_ADD_PUBLIC_IP will implicitly trigger
+	 * CTDB_SRVID_TAKEOVER_RUN broadcast to all connected nodes.
+	 *
+	 * That means CTDB_{CONTROL,EVENT,SRVID}_IPREALLOCATED is
+	 * triggered at the end of the takeover run...
+	 *
+	 * So we don't need to call ipreallocate() nor
+	 * send_ipreallocated_control_to_nodes() here...
+	 */
+
 	return 0;
 }
 
@@ -4086,6 +4146,21 @@ static int control_delip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
 		return ret;
 	}
 
+	/*
+	 * CTDB_CONTROL_DEL_PUBLIC_IP only marks the public ip
+	 * with pending_delete if it's still in use.
+	 *
+	 * Any later takeover run will really move the public ip
+	 * away from the local node and finally removes it.
+	 *
+	 * That means CTDB_{CONTROL,EVENT,SRVID}_IPREALLOCATED is
+	 * triggered at the end of the takeover run that actually
+	 * moves the public ip away.
+	 *
+	 * So we don't need to call ipreallocate() nor
+	 * send_ipreallocated_control_to_nodes() here...
+	 */
+
 	return 0;
 }
 
@@ -5915,6 +5990,32 @@ fail:
 	return ret;
 }
 
+static int send_ipreallocated_control_to_nodes(TALLOC_CTX *mem_ctx,
+					       struct ctdb_context *ctdb,
+					       uint32_t *pnn_list,
+					       int count)
+{
+	struct ctdb_req_control request;
+	int ret;
+
+	ctdb_req_control_ipreallocated(&request);
+	ret = ctdb_client_control_multi(mem_ctx,
+					ctdb->ev,
+					ctdb->client,
+					pnn_list,
+					count,
+					TIMEOUT(),
+					&request,
+					NULL,  /* perr_list */
+					NULL); /* preply */
+	if (ret != 0) {
+		fprintf(stderr, "Failed to send ipreallocated\n");
+		return ret;
+	}
+
+	return 0;
+}
+
 static int control_reloadips(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
 			     int argc, const char **argv)
 {
diff --git a/script/autobuild.py b/script/autobuild.py
index e230c80761e..a10b9aebdef 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -991,16 +991,46 @@ tasks = {
             ("allstatic-make", "make -j"),
             ("allstatic-test", make_test(TESTS="samba3.smb2.create.*nt4_dc")),
             ("allstatic-lcov", LCOV_CMD),
+            ("allstatic-def-check-clean-tree", CLEAN_SOURCE_TREE_CMD),
+            ("allstatic-def-clean", "make clean"),
+
+        # force all libraries as private
+            ("allprivate-def-distclean", "make distclean"),
+            ("allprivate-def-configure", "./configure.developer " + samba_configure_params + " --private-libraries=ALL"),
+            ("allprivate-def-make", "make -j"),
+            # note wrapper libraries need to be public
+            ("allprivate-def-no-public", "ls ./bin/shared | egrep -v '^private$|lib[nprsu][saeoi][smscd].*-wrapper.so$|pam_set_items.so' | wc -l | grep -q '^0'"),
+            ("allprivate-def-only-private-ext", "ls ./bin/shared/private | egrep 'private-samba' | wc -l | grep -q '^0' && exit 1; exit 0"),
+            ("allprivate-def-no-non-private-ext", "ls ./bin/shared/private | egrep -v 'private-samba|^libpypamtest.so$' | wc -l | grep -q '^0'"),
+            ("allprivate-def-test", make_test(TESTS="samba3.smb2.create.*nt4_dc")),
+            ("allprivate-def-lcov", LCOV_CMD),
+            ("allprivate-def-check-clean-tree", CLEAN_SOURCE_TREE_CMD),
+            ("allprivate-def-clean", "make clean"),
+
+        # force all libraries as private with a non default
+        # extension and 2 exceptions
+            ("allprivate-ext-distclean", "make distclean"),
+            ("allprivate-ext-configure", "./configure.developer " + samba_configure_params + " --private-libraries=ALL --private-library-extension=private-library --private-extension-exception=pac,ndr"),
+            ("allprivate-ext-make", "make -j"),
+            # note wrapper libraries need to be public
+            ("allprivate-ext-no-public", "ls ./bin/shared | egrep -v '^private$|lib[nprsu][saeoi][smscd].*-wrapper.so$|pam_set_items.so' | wc -l | grep -q '^0'"),
+            ("allprivate-ext-no-private-default-ext", "ls ./bin/shared/private | grep 'private-samba' | wc -l | grep -q '^0'"),
+            ("allprivate-ext-has-private-ext", "ls ./bin/shared/private | grep 'private-library' | wc -l | grep -q '^0' && exit 1; exit 0"),
+            ("allprivate-ext-libndr-no-private-ext", "ls ./bin/shared/private | grep -v 'private-library' | grep 'libndr' | wc -l | grep -q '^1'"),
+            ("allprivate-ext-libpac-no-private-ext", "ls ./bin/shared/private | grep -v 'private-library' | grep 'libpac' | wc -l | grep -q '^1'"),
+            ("allprivate-ext-test", make_test(TESTS="samba3.smb2.create.*nt4_dc")),
+            ("allprivate-ext-lcov", LCOV_CMD),
+            ("allprivate-ext-check-clean-tree", CLEAN_SOURCE_TREE_CMD),
+            ("allprivate-ext-clean", "make clean"),
 
         # retry with nonshared smbd and smbtorture
             ("nonshared-distclean", "make distclean"),
             ("nonshared-configure", "./configure.developer " + samba_configure_params + " --bundled-libraries=ALL --with-static-modules=ALL --nonshared-binary=smbtorture,smbd/smbd"),
             ("nonshared-make", "make -j"),
-            # TODO ("nonshared-test", make_test(TESTS="samba3.smb2.create.*nt4_dc")),
-            # TODO ("nonshared-lcov", LCOV_CMD),
-
-            ("check-clean-tree", CLEAN_SOURCE_TREE_CMD),
-            ("clean", "make clean"),
+            ("nonshared-test", make_test(TESTS="samba3.smb2.create.*nt4_dc")),
+            ("nonshared-lcov", LCOV_CMD),
+            ("nonshared-check-clean-tree", CLEAN_SOURCE_TREE_CMD),
+            ("nonshared-clean", "make clean"),
         ],
     },
 
diff --git a/source3/smbd/smb2_ioctl_network_fs.c b/source3/smbd/smb2_ioctl_network_fs.c
index 5b396855ca6..9ef99dca90f 100644
--- a/source3/smbd/smb2_ioctl_network_fs.c
+++ b/source3/smbd/smb2_ioctl_network_fs.c
@@ -366,7 +366,7 @@ static NTSTATUS fsctl_network_iface_info(TALLOC_CTX *mem_ctx,
 	struct fsctl_net_iface_info *first = NULL;
 	struct fsctl_net_iface_info *last = NULL;
 	size_t i;
-	size_t num_ifaces = iface_count();
+	size_t num_ifaces;
 	enum ndr_err_code ndr_err;
 	struct cluster_movable_ips *cluster_movable_ips = NULL;
 	int ret;
@@ -375,6 +375,16 @@ static NTSTATUS fsctl_network_iface_info(TALLOC_CTX *mem_ctx,
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
+	/*
+	 * The list of probed interfaces might have changed, we might need to
+	 * refresh local_interfaces to get up-to-date network information, and
+	 * respond to clients which sent FSCTL_QUERY_NETWORK_INTERFACE_INFO.
+	 * For example, network speed is changed, interfaces count is changed
+	 * (some link down or link up), and etc.
+	 */
+	load_interfaces();
+	num_ifaces = iface_count();
+
 	*out_output = data_blob_null;
 
 	array = talloc_zero_array(mem_ctx,
diff --git a/third_party/nss_wrapper/wscript b/third_party/nss_wrapper/wscript
index 178e4e16eef..28aeb510719 100644
--- a/third_party/nss_wrapper/wscript
+++ b/third_party/nss_wrapper/wscript
@@ -87,10 +87,11 @@ def configure(conf):
 def build(bld):
     if bld.CONFIG_SET("HAVE_NSS_H") and not bld.CONFIG_SET("USING_SYSTEM_NSS_WRAPPER"):
         # We need to do it this way or the library wont work.
-        # Using private_library=True will add symbol version which
+        # We need force_unversioned=True as symbol versioning
         # breaks preloading!
         bld.SAMBA_LIBRARY('nss_wrapper',
                           source='nss_wrapper.c nss_utils.c',
                           deps='dl pthread',
                           install=False,
+                          force_unversioned=True,
                           realname='libnss-wrapper.so')
diff --git a/third_party/pam_wrapper/wscript b/third_party/pam_wrapper/wscript
index 3ce89bbbc27..599072fe478 100644
--- a/third_party/pam_wrapper/wscript
+++ b/third_party/pam_wrapper/wscript
@@ -87,12 +87,13 @@ def configure(conf):
 def build(bld):
     if not bld.CONFIG_SET("USING_SYSTEM_PAM_WRAPPER"):
         # We need to do it this way or the library wont work.
-        # Using private_library=True will add symbol version which
+        # We need force_unversioned=True as symbol versioning
         # breaks preloading!
         bld.SAMBA_LIBRARY('pam_wrapper',
                           source='pam_wrapper.c',
                           deps='dl pthread',
                           install=False,
+                          force_unversioned=True,
                           realname='libpam-wrapper.so')
 
         bld.SAMBA_SUBSYSTEM('libpamtest',
@@ -103,6 +104,7 @@ def build(bld):
                           source='modules/pam_set_items.c',
                           deps='pam',
                           install=False,
+                          force_unversioned=True,
                           realname='pam_set_items.so')
 
         pypamtest_cflags = ''
diff --git a/third_party/resolv_wrapper/wscript b/third_party/resolv_wrapper/wscript
index 9aa06bc1508..43b38d61b6a 100644
--- a/third_party/resolv_wrapper/wscript
+++ b/third_party/resolv_wrapper/wscript
@@ -85,10 +85,11 @@ def configure(conf):
 def build(bld):
     if bld.CONFIG_SET("HAVE_RESOLV_H") and not bld.CONFIG_SET("USING_SYSTEM_RESOLV_WRAPPER"):
         # We need to do it this way or the library wont work.
-        # Using private_library=True will add symbol version which
+        # We need force_unversioned=True as symbol versioning
         # breaks preloading!
         bld.SAMBA_LIBRARY('resolv_wrapper',
                           source='resolv_wrapper.c',
                           deps='dl resolv',


-- 
Samba Shared Repository



More information about the samba-cvs mailing list