nmbd_elections.c: Removed force elections code to bring into line with 1.9.18.
authorJeremy Allison <jra@samba.org>
Mon, 29 Jun 1998 22:50:49 +0000 (22:50 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 29 Jun 1998 22:50:49 +0000 (22:50 +0000)
nmbd_namelistdb.c: Added comment for Chris.
nmbd_subnetdb.c: Went back to Chris's comparison code as with the make_nmb_name
                 change it all works now.
lib/rpc/server/srv_netlog.c: Ensure we return 'account disabled' for disabled
                             accounts, rather than crashing.
Jeremy.

source/nmbd/nmbd_elections.c
source/nmbd/nmbd_namelistdb.c
source/nmbd/nmbd_subnetdb.c
source/rpc_server/srv_netlog.c

index ceef961d5e95e8fe7d50717091248b5b34cb03d9..5c85191ec2c3ce9a55d5a826e6302e443416d0f2 100644 (file)
@@ -378,9 +378,6 @@ yet registered on subnet %s\n", namestr(&nmbname), subrec->subnet_name ));
         work->ElectionCount = 0;
         work->RunningElection = True;
         work->needelection = False;
-
-        /* Send a force election packet to begin. */
-        send_election_dgram(subrec, work->work_group, 0, 0, "");
       }
     }
   }
index b7f185deeb4b79f653b3ea083388c0e04ba3d677..29d822550c4c951ff357f1adf2d2fa783b75292f 100644 (file)
@@ -288,7 +288,9 @@ void standard_success_register(struct subnet_record *subrec,
 
 /*******************************************************************
  Utility function automatically called when a name refresh or register 
- fails.
+ fails. Note that this is only ever called on a broadcast subnet with
+ one IP address per name. This is why it can just delete the name 
+ without enumerating the IP adresses. JRA.
  ******************************************************************/
 
 void standard_fail_register( struct subnet_record   *subrec,
index 40ae1db1b3580590cabc0a95ab8a2c573186f692..36a3ee9a27c33195b8fbaf3d6450199ed1867280 100644 (file)
@@ -74,6 +74,7 @@ static void add_subnet(struct subnet_record *subrec)
 }
 
 /* CRH!!! */
+#if 0
 /* ************************************************************************** ** * This will go away when we move to a "real" database back-end.
   Note that we cannot use memcmp here as we have no control
   over how the struct nmb_name structures are packed in memory. JRA.
@@ -97,6 +98,24 @@ int namelist_entry_compare( ubi_trItemPtr Item, ubi_trNodePtr Node )
 
   return nmbname->name_type - NR->name.name_type;
   } /* namelist_entry_compare */
+#else
+/* ************************************************************************** **
+ * This will go away when we move to a "real" database back-end.
+ * ************************************************************************** **
+ */
+int namelist_entry_compare( ubi_trItemPtr Item, ubi_trNodePtr Node )
+  {
+  struct name_record *NR = (struct name_record *)Node;
+
+  struct nmb_name *Iname = (struct nmb_name *)Item;
+  DEBUG(10, ("namelist_entry_compare: %d == memcmp( \"%s\", \"%s\", %d )\n",
+          memcmp( Item, &(NR->name), sizeof(struct nmb_name) ),
+          namestr(Iname), namestr(&NR->name), sizeof(struct nmb_name)) );
+
+  return( memcmp( Item, &(NR->name), sizeof(struct nmb_name) ) ); 
+  } /* namelist_entry_compare */
+
+#endif
 /* CRH!!! */   
 
 /****************************************************************************
index 8bcf1682bcb445ff0a867fcdb202e0c30c6d294f..cb22cfddf0256582e2418596ada05b5ea779885a 100644 (file)
@@ -252,7 +252,8 @@ static BOOL get_md4pw(char *md4pw, char *mach_name, char *mach_acct)
        smb_pass = getsmbpwnam(mach_acct);
        unbecome_root(True);
 
-       if (smb_pass != NULL)
+       if ((smb_pass) != NULL && !(smb_pass->acct_ctrl & ACB_DISABLED) &&
+        (smb_pass->smb_nt_passwd != NULL))
        {
                memcpy(md4pw, smb_pass->smb_nt_passwd, 16);
                dump_data(5, md4pw, 16);
@@ -656,9 +657,9 @@ static void api_net_sam_logon( int uid,
     unbecome_root(True);
 
     if (smb_pass == NULL)
-    {
       status = 0xC0000000 | NT_STATUS_NO_SUCH_USER;
-    }
+    else if (smb_pass->acct_ctrl & ACB_DISABLED)
+      status =  0xC0000000 | NT_STATUS_ACCOUNT_DISABLED;
   }
 
   /* validate password. */