s3-nbt: remove double nbt netlogon opcodes.
authorGünther Deschner <gd@samba.org>
Wed, 24 Sep 2008 07:05:37 +0000 (09:05 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 26 Nov 2008 09:13:32 +0000 (10:13 +0100)
Guenther
(cherry picked from commit 81fde585516957b6a7742e0168c68df33572ed74)
(cherry picked from commit cae36caaaea944bf18a0d956da2d241c0fe563b5)

source/include/nameserv.h
source/nmbd/nmbd_processlogon.c
source/utils/net_ads.c

index 4377e3330a1cfcf5514c498cf4581ccc679cc964..a7d46e72d8c9516bd723a5272d0f37c95a41b53a 100644 (file)
@@ -539,17 +539,6 @@ struct packet_struct
        } packet;
 };
 
-/* NETLOGON opcodes */
-
-#define QUERYFORPDC     7 /* Query for PDC. */
-#define SAM_UAS_CHANGE  10 /* Announce change to UAS or SAM. */
-#define QUERYFORPDC_R  12 /* Response to Query for PDC. */
-#define SAMLOGON       18
-#define SAMLOGON_R     19
-#define SAMLOGON_UNK_R 21
-#define SAMLOGON_AD_UNK_R 23
-#define SAMLOGON_AD_R   25
-
 /* Ids for netbios packet types. */
 
 #define ANN_HostAnnouncement         1
index 474ae1ca1868946a706336d41f7113e6d398230f..814eaf7ca84984856a5ee53dd0998a63d7253d48 100644 (file)
@@ -178,7 +178,7 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
                                break;
                        }
 
-               case QUERYFORPDC:
+               case LOGON_PRIMARY_QUERY:
                        {
                                fstring mach_str, getdc_str;
                                fstring source_name;
@@ -253,7 +253,7 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
 
                                /* Construct reply. */
                                q = outbuf;
-                               SSVAL(q, 0, QUERYFORPDC_R);
+                               SSVAL(q, 0, NETLOGON_RESPONSE_FROM_PDC);
                                q += 2;
 
                                fstrcpy(reply_name,my_name);
@@ -292,7 +292,7 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
                                DEBUG(5,("process_logon_packet: GETDC request from %s at IP %s, \
 reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                                        mach_str,inet_ntoa(p->ip), reply_name, lp_workgroup(),
-                                       QUERYFORPDC_R, (uint32)ntversion, (uint32)lmnttoken,
+                                       NETLOGON_RESPONSE_FROM_PDC, (uint32)ntversion, (uint32)lmnttoken,
                                        (uint32)lm20token ));
 
                                dump_data(4, (uint8 *)outbuf, PTR_DIFF(q, outbuf));
@@ -309,7 +309,7 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                                return;
                        }
 
-               case SAMLOGON:
+               case LOGON_SAM_LOGON_REQUEST:
 
                        {
                                fstring getdc_str;
@@ -351,7 +351,7 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                                domainsidsize = IVAL(q, 0);
                                q += 4;
 
-                               DEBUG(5,("process_logon_packet: SAMLOGON sidsize %d, len = %d\n", domainsidsize, len));
+                               DEBUG(5,("process_logon_packet: LOGON_SAM_LOGON_REQUEST sidsize %d, len = %d\n", domainsidsize, len));
 
                                if (domainsidsize < (len - PTR_DIFF(q, buf)) && (domainsidsize != 0)) {
                                        q += domainsidsize;
@@ -383,7 +383,7 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                                lm20token = SVAL(q, 6);
                                q += 8;
 
-                               DEBUG(3,("process_logon_packet: SAMLOGON sidsize %d ntv %d\n", domainsidsize, ntversion));
+                               DEBUG(3,("process_logon_packet: LOGON_SAM_LOGON_REQUEST sidsize %d ntv %d\n", domainsidsize, ntversion));
 
                                /*
                                 * we respond regadless of whether the machine is in our password 
@@ -392,14 +392,14 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                                 */
                                pull_ucs2_fstring(ascuser, uniuser);
                                pull_ucs2_fstring(asccomp, unicomp);
-                               DEBUG(5,("process_logon_packet: SAMLOGON user %s\n", ascuser));
+                               DEBUG(5,("process_logon_packet: LOGON_SAM_LOGON_REQUEST user %s\n", ascuser));
 
                                fstrcpy(reply_name, "\\\\"); /* Here it wants \\LOGONSERVER. */
                                fstrcat(reply_name, my_name);
 
-                               DEBUG(5,("process_logon_packet: SAMLOGON request from %s(%s) for %s, returning logon svr %s domain %s code %x token=%x\n",
+                               DEBUG(5,("process_logon_packet: LOGON_SAM_LOGON_REQUEST request from %s(%s) for %s, returning logon svr %s domain %s code %x token=%x\n",
                                        asccomp,inet_ntoa(p->ip), ascuser, reply_name, lp_workgroup(),
-                               SAMLOGON_R ,lmnttoken));
+                               LOGON_SAM_LOGON_RESPONSE ,lmnttoken));
 
                                /* Construct reply. */
 
@@ -408,9 +408,9 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                                /* never, at least for now */
                                if ((ntversion < 11) || (SEC_ADS != lp_security()) || (ROLE_DOMAIN_PDC != lp_server_role())) {
                                        if (SVAL(uniuser, 0) == 0) {
-                                               SSVAL(q, 0, SAMLOGON_UNK_R);    /* user unknown */
+                                               SSVAL(q, 0, LOGON_SAM_LOGON_USER_UNKNOWN);      /* user unknown */
                                        } else {
-                                               SSVAL(q, 0, SAMLOGON_R);
+                                               SSVAL(q, 0, LOGON_SAM_LOGON_RESPONSE);
                                        }
 
                                        q += 2;
@@ -453,9 +453,9 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                                                return;
                                        }
                                        if (SVAL(uniuser, 0) == 0) {
-                                               SIVAL(q, 0, SAMLOGON_AD_UNK_R); /* user unknown */
+                                               SIVAL(q, 0, LOGON_SAM_LOGON_USER_UNKNOWN_EX);   /* user unknown */
                                        } else {
-                                               SIVAL(q, 0, SAMLOGON_AD_R);
+                                               SIVAL(q, 0, LOGON_SAM_LOGON_RESPONSE_EX);
                                        }
                                        q += 4;
 
@@ -684,8 +684,8 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                /* Announce change to UAS or SAM.  Send by the domain controller when a
                replication event is required. */
 
-               case SAM_UAS_CHANGE:
-                       DEBUG(5, ("Got SAM_UAS_CHANGE\n"));
+               case NETLOGON_ANNOUNCE_UAS:
+                       DEBUG(5, ("Got NETLOGON_ANNOUNCE_UAS\n"));
                        break;
 
                default:
index 1ef4c152a3db90a2865fbe0cdb9fec1f5c13e865..627374cb96bb82162a7f31f01849479ad8fb52f3 100644 (file)
@@ -56,11 +56,11 @@ static int net_ads_cldap_netlogon(struct net_context *c, ADS_STRUCT *ads)
 
        d_printf("Response Type: ");
        switch (reply.command) {
-       case SAMLOGON_AD_UNK_R:
-               d_printf("SAMLOGON\n");
+       case LOGON_SAM_LOGON_USER_UNKNOWN_EX:
+               d_printf("LOGON_SAM_LOGON_USER_UNKNOWN_EX\n");
                break;
-       case SAMLOGON_AD_R:
-               d_printf("SAMLOGON_USER\n");
+       case LOGON_SAM_LOGON_RESPONSE_EX:
+               d_printf("LOGON_SAM_LOGON_RESPONSE_EX\n");
                break;
        default:
                d_printf("0x%x\n", reply.command);