svn commit: samba r23783 - in branches: SAMBA_3_2/source/nmbd SAMBA_3_2/source/smbd SAMBA_3_2_0/source/nmbd SAMBA_3_2_0/source/smbd

tridge at samba.org tridge at samba.org
Tue Jul 10 00:47:41 GMT 2007


Author: tridge
Date: 2007-07-10 00:47:40 +0000 (Tue, 10 Jul 2007)
New Revision: 23783

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23783

Log:
Processing the UAS change message was causing problems on ppc64 Linux
systems. Rather than trying to fix this, it's much better just to
remove the code, as it serves no purpose at all (the message that is
generated is ignored by smbd).

This sort of parsing should really be done by PIDL generated code.


Modified:
   branches/SAMBA_3_2/source/nmbd/nmbd_processlogon.c
   branches/SAMBA_3_2/source/smbd/server.c
   branches/SAMBA_3_2_0/source/nmbd/nmbd_processlogon.c
   branches/SAMBA_3_2_0/source/smbd/server.c


Changeset:
Modified: branches/SAMBA_3_2/source/nmbd/nmbd_processlogon.c
===================================================================
--- branches/SAMBA_3_2/source/nmbd/nmbd_processlogon.c	2007-07-09 22:15:22 UTC (rev 23782)
+++ branches/SAMBA_3_2/source/nmbd/nmbd_processlogon.c	2007-07-10 00:47:40 UTC (rev 23783)
@@ -33,18 +33,6 @@
 };
 
 /****************************************************************************
-Send a message to smbd to do a sam delta sync
-**************************************************************************/
-
-static void send_repl_message(uint32 low_serial)
-{
-        DEBUG(3, ("sending replication message, serial = 0x%04x\n", 
-                  low_serial));
-        message_send_all(nmbd_messaging_context(), MSG_SMB_SAM_REPL,
-			 &low_serial, sizeof(low_serial), NULL);
-}
-
-/****************************************************************************
 Process a domain logon packet
 **************************************************************************/
 
@@ -505,103 +493,9 @@
 		replication event is required. */
 
 		case SAM_UAS_CHANGE:
-			{
-				struct sam_database_info *db_info;
-				char *q = buf + 2;
-				int i, db_count;
-				uint32 low_serial;
-          
-				/* Header */
-          
-				if (PTR_DIFF(q + 16, buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
+			DEBUG(5, ("Got SAM_UAS_CHANGE\n"));
+			break;
 
-				low_serial = IVAL(q, 0); q += 4;     /* Low serial number */
-
-				q += 4;                   /* Date/time */
-				q += 4;                   /* Pulse */
-				q += 4;                   /* Random */
-          
-				/* Domain info */
-          
-				q = skip_string(buf,len,q);    /* PDC name */
-
-				if (!q || PTR_DIFF(q, buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
-
-				q = skip_string(buf,len,q);    /* Domain name */
-
-				if (!q || PTR_DIFF(q, buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
-
-				q = skip_unibuf(q, PTR_DIFF(buf + len, q)); /* Unicode PDC name */
-
-				if (PTR_DIFF(q, buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
-
-				q = skip_unibuf(q, PTR_DIFF(buf + len, q)); /* Unicode domain name */
-          
-				/* Database info */
-          
-				if (PTR_DIFF(q + 2, buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
-
-				db_count = SVAL(q, 0); q += 2;
-
-				if (PTR_DIFF(q + (db_count*20), buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
-
-				db_info = SMB_MALLOC_ARRAY(struct sam_database_info, db_count);
-
-				if (db_info == NULL) {
-					DEBUG(3, ("out of memory allocating info for %d databases\n", db_count));
-					return;
-				}
-          
-				for (i = 0; i < db_count; i++) {
-					db_info[i].index = IVAL(q, 0);
-					db_info[i].serial_lo = IVAL(q, 4);
-					db_info[i].serial_hi = IVAL(q, 8);
-					db_info[i].date_lo = IVAL(q, 12);
-					db_info[i].date_hi = IVAL(q, 16);
-					q += 20;
-				}
-
-				/* Domain SID */
-
-#if 0
-				/* We must range check this. */
-				q += IVAL(q, 0) + 4;  /* 4 byte length plus data */
-          
-				q += 2;               /* Alignment? */
-
-				/* Misc other info */
-
-				q += 4;               /* NT version (0x1) */
-				q += 2;               /* LMNT token (0xff) */
-				q += 2;               /* LM20 token (0xff) */
-#endif
-
-				SAFE_FREE(db_info);        /* Not sure whether we need to do anything useful with these */
-
-				/* Send message to smbd */
-
-				send_repl_message(low_serial);
-				break;
-			}
-
 		default:
 			DEBUG(3,("process_logon_packet: Unknown domain request %d\n",code));
 			return;

Modified: branches/SAMBA_3_2/source/smbd/server.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/server.c	2007-07-09 22:15:22 UTC (rev 23782)
+++ branches/SAMBA_3_2/source/smbd/server.c	2007-07-10 00:47:40 UTC (rev 23783)
@@ -166,28 +166,7 @@
         DEBUG(10, ("** sam sync message received, ignoring\n"));
 }
 
-/****************************************************************************
- Process a sam sync replicate message - not sure whether to do this here or
- somewhere else.
-****************************************************************************/
 
-static void msg_sam_repl(struct messaging_context *msg,
-			 void *private_data,
-			 uint32_t msg_type,
-			 struct server_id server_id,
-			 DATA_BLOB *data)
-{
-        uint32 low_serial;
-
-        if (data->length != sizeof(low_serial))
-                return;
-
-        low_serial = *((uint32 *)data->data);
-
-        DEBUG(3, ("received sam replication message, serial = 0x%04x\n",
-                  low_serial));
-}
-
 /****************************************************************************
  Open the socket communication - inetd.
 ****************************************************************************/
@@ -376,8 +355,6 @@
 	messaging_register(smbd_messaging_context(), NULL,
 			   MSG_SMB_SAM_SYNC, msg_sam_sync);
 	messaging_register(smbd_messaging_context(), NULL,
-			   MSG_SMB_SAM_REPL, msg_sam_repl);
-	messaging_register(smbd_messaging_context(), NULL,
 			   MSG_SHUTDOWN, msg_exit_server);
 	messaging_register(smbd_messaging_context(), NULL,
 			   MSG_SMB_FILE_RENAME, msg_file_was_renamed);

Modified: branches/SAMBA_3_2_0/source/nmbd/nmbd_processlogon.c
===================================================================
--- branches/SAMBA_3_2_0/source/nmbd/nmbd_processlogon.c	2007-07-09 22:15:22 UTC (rev 23782)
+++ branches/SAMBA_3_2_0/source/nmbd/nmbd_processlogon.c	2007-07-10 00:47:40 UTC (rev 23783)
@@ -33,18 +33,6 @@
 };
 
 /****************************************************************************
-Send a message to smbd to do a sam delta sync
-**************************************************************************/
-
-static void send_repl_message(uint32 low_serial)
-{
-        DEBUG(3, ("sending replication message, serial = 0x%04x\n", 
-                  low_serial));
-        message_send_all(nmbd_messaging_context(), MSG_SMB_SAM_REPL,
-			 &low_serial, sizeof(low_serial), NULL);
-}
-
-/****************************************************************************
 Process a domain logon packet
 **************************************************************************/
 
@@ -505,103 +493,9 @@
 		replication event is required. */
 
 		case SAM_UAS_CHANGE:
-			{
-				struct sam_database_info *db_info;
-				char *q = buf + 2;
-				int i, db_count;
-				uint32 low_serial;
-          
-				/* Header */
-          
-				if (PTR_DIFF(q + 16, buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
+			DEBUG(5, ("Got SAM_UAS_CHANGE\n"));
+			break;
 
-				low_serial = IVAL(q, 0); q += 4;     /* Low serial number */
-
-				q += 4;                   /* Date/time */
-				q += 4;                   /* Pulse */
-				q += 4;                   /* Random */
-          
-				/* Domain info */
-          
-				q = skip_string(buf,len,q);    /* PDC name */
-
-				if (!q || PTR_DIFF(q, buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
-
-				q = skip_string(buf,len,q);    /* Domain name */
-
-				if (!q || PTR_DIFF(q, buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
-
-				q = skip_unibuf(q, PTR_DIFF(buf + len, q)); /* Unicode PDC name */
-
-				if (PTR_DIFF(q, buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
-
-				q = skip_unibuf(q, PTR_DIFF(buf + len, q)); /* Unicode domain name */
-          
-				/* Database info */
-          
-				if (PTR_DIFF(q + 2, buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
-
-				db_count = SVAL(q, 0); q += 2;
-
-				if (PTR_DIFF(q + (db_count*20), buf) >= len) {
-					DEBUG(0,("process_logon_packet: bad packet\n"));
-					return;
-				}
-
-				db_info = SMB_MALLOC_ARRAY(struct sam_database_info, db_count);
-
-				if (db_info == NULL) {
-					DEBUG(3, ("out of memory allocating info for %d databases\n", db_count));
-					return;
-				}
-          
-				for (i = 0; i < db_count; i++) {
-					db_info[i].index = IVAL(q, 0);
-					db_info[i].serial_lo = IVAL(q, 4);
-					db_info[i].serial_hi = IVAL(q, 8);
-					db_info[i].date_lo = IVAL(q, 12);
-					db_info[i].date_hi = IVAL(q, 16);
-					q += 20;
-				}
-
-				/* Domain SID */
-
-#if 0
-				/* We must range check this. */
-				q += IVAL(q, 0) + 4;  /* 4 byte length plus data */
-          
-				q += 2;               /* Alignment? */
-
-				/* Misc other info */
-
-				q += 4;               /* NT version (0x1) */
-				q += 2;               /* LMNT token (0xff) */
-				q += 2;               /* LM20 token (0xff) */
-#endif
-
-				SAFE_FREE(db_info);        /* Not sure whether we need to do anything useful with these */
-
-				/* Send message to smbd */
-
-				send_repl_message(low_serial);
-				break;
-			}
-
 		default:
 			DEBUG(3,("process_logon_packet: Unknown domain request %d\n",code));
 			return;

Modified: branches/SAMBA_3_2_0/source/smbd/server.c
===================================================================
--- branches/SAMBA_3_2_0/source/smbd/server.c	2007-07-09 22:15:22 UTC (rev 23782)
+++ branches/SAMBA_3_2_0/source/smbd/server.c	2007-07-10 00:47:40 UTC (rev 23783)
@@ -165,28 +165,7 @@
         DEBUG(10, ("** sam sync message received, ignoring\n"));
 }
 
-/****************************************************************************
- Process a sam sync replicate message - not sure whether to do this here or
- somewhere else.
-****************************************************************************/
 
-static void msg_sam_repl(struct messaging_context *msg,
-			 void *private_data,
-			 uint32_t msg_type,
-			 struct server_id server_id,
-			 DATA_BLOB *data)
-{
-        uint32 low_serial;
-
-        if (data->length != sizeof(low_serial))
-                return;
-
-        low_serial = *((uint32 *)data->data);
-
-        DEBUG(3, ("received sam replication message, serial = 0x%04x\n",
-                  low_serial));
-}
-
 /****************************************************************************
  Open the socket communication - inetd.
 ****************************************************************************/
@@ -462,8 +441,6 @@
 	messaging_register(smbd_messaging_context(), NULL,
 			   MSG_SMB_SAM_SYNC, msg_sam_sync);
 	messaging_register(smbd_messaging_context(), NULL,
-			   MSG_SMB_SAM_REPL, msg_sam_repl);
-	messaging_register(smbd_messaging_context(), NULL,
 			   MSG_SHUTDOWN, msg_exit_server);
 	messaging_register(smbd_messaging_context(), NULL,
 			   MSG_SMB_FILE_RENAME, msg_file_was_renamed);



More information about the samba-cvs mailing list