[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Thu Aug 11 09:10:03 MDT 2011


The branch, master has been updated
       via  d52343a s3-messaging: Do not register to classes we are not going to use.
       via  9f12575 s3-messaging: Change classification of MSG_SMB_CONF_UPDATED.
       via  b706fd3 s3-messaging: Fix messaging classes.
       via  cb1af61 s3-messaging: Remove obsolete class.
      from  91a4549 s3:build(autoconf): fix bug #8369: remove irritating "." targets when recent system libs exist

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


- Log -----------------------------------------------------------------
commit d52343a9673a55e0e11d35f904808c0007405fa4
Author: Simo Sorce <idra at samba.org>
Date:   Wed Aug 10 23:28:09 2011 -0400

    s3-messaging: Do not register to classes we are not going to use.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User: Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date: Thu Aug 11 17:09:30 CEST 2011 on sn-devel-104

commit 9f12575712fc2d5fb44558562f482cd8459140e8
Author: Simo Sorce <idra at samba.org>
Date:   Wed Aug 10 23:25:56 2011 -0400

    s3-messaging: Change classification of MSG_SMB_CONF_UPDATED.
    
    smbd is not the only daemon interested in smb.conf changes. Move this
    message to the GENERAL class so that all interested partied (nmbd,
    winbindd, spoolssd, etc..) can receive this notification.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>

commit b706fd37f6d0e7e66718488d069053687ad0664c
Author: Simo Sorce <idra at samba.org>
Date:   Wed Aug 10 23:10:48 2011 -0400

    s3-messaging: Fix messaging classes.
    
    This has been broken since ff0ac5b0 (May 2007).
    Basically all messages were belonging to the General class except for CTDB
    messages.
    This fixed the message_send_all() function to correctly compute the class, and
    fixes registrations to include all they need to cope with the fact not all
    messages are of calss general (registrations rotted a bit because as long as
    FLAG_MSG_GENERAL was defined the process woould receive all messages).
    
    Signed-off-by: Andreas Schneider <asn at samba.org>

commit cb1af61cb1988931654ad14c787d2493ef629a58
Author: Simo Sorce <idra at samba.org>
Date:   Wed Aug 10 23:36:06 2011 -0400

    s3-messaging: Remove obsolete class.
    
    The FLAG_MSG_PRINT_NOTIFY class is actually obsolete and never used, as the
    only message belonging to it is not used either.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>

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

Summary of changes:
 source3/include/messages.h                  |    3 +--
 source3/lib/messages.c                      |   21 +++++++++++----------
 source3/librpc/idl/messaging.idl            |    9 ++++++---
 source3/nmbd/nmbd.c                         |    4 +++-
 source3/printing/queue_process.c            |    4 ++--
 source3/printing/spoolssd.c                 |    3 ---
 source3/rpc_server/epmd.c                   |    4 ++--
 source3/rpc_server/spoolss/srv_spoolss_nt.c |   13 -------------
 source3/winbindd/winbindd.c                 |    4 +++-
 9 files changed, 28 insertions(+), 37 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/messages.h b/source3/include/messages.h
index 41d5bb1..c15dadc 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -42,12 +42,11 @@
 #define FLAG_MSG_GENERAL		0x0001
 #define FLAG_MSG_SMBD			0x0002
 #define FLAG_MSG_NMBD			0x0004
-#define FLAG_MSG_PRINT_NOTIFY		0x0008
+#define FLAG_MSG_WINBIND		0x0008
 #define FLAG_MSG_PRINT_GENERAL		0x0010
 /* dbwrap messages 4001-4999 */
 #define FLAG_MSG_DBWRAP			0x0020
 
-
 /*
  * ctdb gives us 64-bit server ids for messaging_send. This is done to avoid
  * pid clashes and to be able to register for special messages like "all
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index d66af39..57a2e22 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -146,20 +146,21 @@ bool message_send_all(struct messaging_context *msg_ctx,
 	struct msg_all msg_all;
 
 	msg_all.msg_type = msg_type;
-	if (msg_type < 1000)
+	if (msg_type < 0x100) {
 		msg_all.msg_flag = FLAG_MSG_GENERAL;
-	else if (msg_type > 1000 && msg_type < 2000)
+	} else if (msg_type > 0x100 && msg_type < 0x200) {
 		msg_all.msg_flag = FLAG_MSG_NMBD;
-	else if (msg_type > 2000 && msg_type < 2100)
-		msg_all.msg_flag = FLAG_MSG_PRINT_NOTIFY;
-	else if (msg_type > 2100 && msg_type < 3000)
+	} else if (msg_type > 0x200 && msg_type < 0x300) {
 		msg_all.msg_flag = FLAG_MSG_PRINT_GENERAL;
-	else if (msg_type > 3000 && msg_type < 4000)
+	} else if (msg_type > 0x300 && msg_type < 0x400) {
 		msg_all.msg_flag = FLAG_MSG_SMBD;
-	else if (msg_type > 4000 && msg_type < 5000)
+	} else if (msg_type > 0x400 && msg_type < 0x600) {
+		msg_all.msg_flag = FLAG_MSG_WINBIND;
+	} else if (msg_type > 4000 && msg_type < 5000) {
 		msg_all.msg_flag = FLAG_MSG_DBWRAP;
-	else
-		return False;
+	} else {
+		return false;
+	}
 
 	msg_all.buf = buf;
 	msg_all.len = len;
@@ -169,7 +170,7 @@ bool message_send_all(struct messaging_context *msg_ctx,
 	serverid_traverse(traverse_fn, &msg_all);
 	if (n_sent)
 		*n_sent = msg_all.n_sent;
-	return True;
+	return true;
 }
 
 struct event_context *messaging_event_context(struct messaging_context *msg_ctx)
diff --git a/source3/librpc/idl/messaging.idl b/source3/librpc/idl/messaging.idl
index 0c0672c..aca90c4 100644
--- a/source3/librpc/idl/messaging.idl
+++ b/source3/librpc/idl/messaging.idl
@@ -39,13 +39,16 @@ interface messaging
 		MSG_IDMAP_DELETE                = 0x000F,
 		MSG_IDMAP_KILL                  = 0x0010,
 
+		/* Changes to smb.conf are really of general interest */
+		MSG_SMB_CONF_UPDATED		= 0x0021,
+
 		/* nmbd messages */
 		MSG_FORCE_ELECTION		= 0x0101,
 		MSG_WINS_NEW_ENTRY		= 0x0102,
 		MSG_SEND_PACKET			= 0x0103,
 
 		/* printing messages */
-		MSG_PRINTER_NOTIFY		= 0x2001, /* Obsolete */
+		/* MSG_PRINTER_NOTIFY		= 0x2001,  Obsoleted */
 		MSG_PRINTER_NOTIFY2		= 0x0202,
 		MSG_PRINTER_DRVUPGRADE		= 0x0203,
 		MSG_PRINTERDATA_INIT_RESET	= 0x0204,
@@ -54,7 +57,7 @@ interface messaging
 		MSG_PRINTER_PCAP		= 0x0207,
 
 		/* smbd messages */
-		MSG_SMB_CONF_UPDATED		= 0x0301,
+		/* MSG_SMB_CONF_UPDATED		= 0x0301,  Obsoleted */
 		MSG_SMB_FORCE_TDIS		= 0x0302,
 		MSG_SMB_SAM_SYNC		= 0x0303,
 		MSG_SMB_SAM_REPL		= 0x0304,
@@ -94,7 +97,7 @@ interface messaging
 		/* event messages */
 		MSG_DUMP_EVENT_LIST		= 0x0500,
 
-		/* dbwrap messages 4001-4999 */
+		/* dbwrap messages 4001-4999 (0x0FA0 - 0x1387) */
 		MSG_DBWRAP_TDB2_CHANGES		= 4001,
 		MSG_DBWRAP_G_LOCK_RETRY		= 4002
 	} messaging_type;
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index ceec2fd..08a5504 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -932,7 +932,9 @@ static bool open_sockets(bool isdaemon, int port)
 	/* get broadcast messages */
 
 	if (!serverid_register(procid_self(),
-			       FLAG_MSG_GENERAL|FLAG_MSG_DBWRAP)) {
+				FLAG_MSG_GENERAL |
+				FLAG_MSG_NMBD |
+				FLAG_MSG_DBWRAP)) {
 		DEBUG(1, ("Could not register myself in serverid.tdb\n"));
 		exit(1);
 	}
diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c
index fd4f3c7..9039e5c 100644
--- a/source3/printing/queue_process.c
+++ b/source3/printing/queue_process.c
@@ -275,8 +275,8 @@ pid_t start_background_queue(struct tevent_context *ev,
 		}
 
 		if (!serverid_register(procid_self(),
-				       FLAG_MSG_GENERAL|FLAG_MSG_SMBD
-				       |FLAG_MSG_PRINT_GENERAL)) {
+				       FLAG_MSG_GENERAL |
+				       FLAG_MSG_PRINT_GENERAL)) {
 			exit(1);
 		}
 
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index 38671ca..09ffc05 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -349,7 +349,6 @@ static bool spoolss_child_init(struct tevent_context *ev_ctx,
 
 	if (!serverid_register(procid_self(),
 				FLAG_MSG_GENERAL |
-				FLAG_MSG_PRINT_NOTIFY |
 				FLAG_MSG_PRINT_GENERAL)) {
 		return false;
 	}
@@ -824,8 +823,6 @@ pid_t start_spoolssd(struct tevent_context *ev_ctx,
 
 	if (!serverid_register(procid_self(),
 				FLAG_MSG_GENERAL |
-				FLAG_MSG_SMBD |
-				FLAG_MSG_PRINT_NOTIFY |
 				FLAG_MSG_PRINT_GENERAL)) {
 		exit(1);
 	}
diff --git a/source3/rpc_server/epmd.c b/source3/rpc_server/epmd.c
index d036b25..8c7efb4 100644
--- a/source3/rpc_server/epmd.c
+++ b/source3/rpc_server/epmd.c
@@ -177,8 +177,8 @@ void start_epmd(struct tevent_context *ev_ctx,
 	epmd_setup_sig_hup_handler(ev_ctx, msg_ctx);
 
 	ok = serverid_register(procid_self(),
-			       FLAG_MSG_GENERAL|FLAG_MSG_SMBD
-			       |FLAG_MSG_PRINT_GENERAL);
+			       FLAG_MSG_GENERAL |
+			       FLAG_MSG_PRINT_GENERAL);
 	if (!ok) {
 		DEBUG(0, ("Failed to register serverid in epmd!\n"));
 		exit(1);
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index ec6f49e..a2f8d68 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -283,15 +283,6 @@ static void srv_spoolss_replycloseprinter(int snum,
 		if (prn_hnd->notify.msg_ctx != NULL) {
 			messaging_deregister(prn_hnd->notify.msg_ctx,
 					     MSG_PRINTER_NOTIFY2, NULL);
-
-			/*
-			 * Tell the serverid.tdb we're no longer
-			 * interested in printer notify messages.
-			 */
-
-			serverid_register_msg_flags(
-				messaging_server_id(prn_hnd->notify.msg_ctx),
-				false, FLAG_MSG_PRINT_NOTIFY);
 		}
 	}
 
@@ -2636,10 +2627,6 @@ static bool srv_spoolss_replyopenprinter(int snum, const char *printer,
 
 		messaging_register(msg_ctx, NULL, MSG_PRINTER_NOTIFY2,
 				   receive_notify2_message_list);
-		/* Tell the connections db we're now interested in printer
-		 * notify messages. */
-		serverid_register_msg_flags(messaging_server_id(msg_ctx),
-					    true, FLAG_MSG_PRINT_NOTIFY);
 	}
 
 	/*
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 0c07d4b..cb9d70c 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -1045,7 +1045,9 @@ void winbindd_register_handlers(void)
 	/* get broadcast messages */
 
 	if (!serverid_register(procid_self(),
-			       FLAG_MSG_GENERAL|FLAG_MSG_DBWRAP)) {
+			       FLAG_MSG_GENERAL |
+			       FLAG_MSG_WINBIND |
+			       FLAG_MSG_DBWRAP)) {
 		DEBUG(1, ("Could not register myself in serverid.tdb\n"));
 		exit(1);
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list