includes.h: Added semaphore fix for HPUX10.x
authorJeremy Allison <jra@samba.org>
Tue, 31 Mar 1998 20:55:14 +0000 (20:55 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 31 Mar 1998 20:55:14 +0000 (20:55 +0000)
server.c trans2.c: Added oplock deadlock bug fix.
lib/rpc/server/srv_netlog.c: Made code that changes machine account password the default.
Jeremy.
(This used to be commit 3b56fbc11e9d1cb7d4930d9782238c2610cac30d)

source3/include/includes.h
source3/rpc_server/srv_netlog.c
source3/smbd/server.c
source3/smbd/trans2.c

index e6dee108a588de6c4592fbea8e110cec2bbc2621..5df76668c6d19df2771ab4525a093adec7405733 100644 (file)
@@ -606,6 +606,11 @@ char *mktemp(char *); /* No standard include */
    not good for HPUX */
 /* #define SIGCLD_IGNORE */
 #define USE_SIGPROCMASK /* Needed to stop zombie processes on HPUX 9.x and 10.x.*/
+#ifdef HPUX10
+#ifdef SEMMSL
+#undef SEMMSL
+#endif /* SEMMSL */
+#endif /* HPUX10 */
 #endif /* HPUX */
 
 
index d7a1b9e4213157eef61b71a687d60fea529d2208..cb3616e4af3d26104b28943d633a088d4184c0d2 100644 (file)
@@ -367,11 +367,9 @@ static void api_net_srv_pwset( int uid,
        NET_Q_SRV_PWSET q_a;
        uint32 status = NT_STATUS_WRONG_PASSWORD|0xC0000000;
        DOM_CRED srv_cred;
-#ifdef ALLOW_SRV_PWSET
-       pstring mach_acct;
+        pstring mach_acct;
        struct smb_passwd *smb_pass;
        BOOL ret;
-#endif
        user_struct *vuser;
 
        if ((vuser = get_valid_user_struct(uid)) == NULL) return;
@@ -387,8 +385,6 @@ static void api_net_srv_pwset( int uid,
 
                DEBUG(5,("api_net_srv_pwset: %d\n", __LINE__));
 
-#ifdef ALLOW_SRV_PWSET
-
                pstrcpy(mach_acct, unistrn2(q_a.clnt_id.login.uni_acct_name.buffer,
                                                                        q_a.clnt_id.login.uni_acct_name.uni_str_len));
 
@@ -401,33 +397,26 @@ static void api_net_srv_pwset( int uid,
                if (smb_pass != NULL)
                {
                        unsigned char pwd[16];
-                       uint8 mode = 2;
 
                        memcpy(pwd, q_a.pwd, 16);
 
-                       if (obfuscate_pwd(pwd, vuser->dc.sess_key, mode))
+                       /* lies!  nt and lm passwords are _not_ the same: don't care */
+                       smb_pass->smb_passwd    = pwd;
+                       smb_pass->smb_nt_passwd = pwd;
+                       smb_pass->acct_ctrl     = ACB_WSTRUST;
+
+                       become_root(True);
+                       ret = mod_smbpwd_entry(smb_pass);
+                       unbecome_root(True);
+
+                       if (ret)
                        {
-                               /* lies!  nt and lm passwords are _not_ the same: don't care */
-                               smb_pass->smb_passwd    = pwd;
-                               smb_pass->smb_nt_passwd = pwd;
-                               smb_pass->acct_ctrl     = ACB_WSTRUST;
-
-                               become_root(True);
-                               ret = mod_smbpwd_entry(smb_pass);
-                               unbecome_root(True);
-
-                               if (ret)
-                               {
-                                       /* hooray! */
-                                       status = 0x0;
-                               }
+                               /* hooray! */
+                               status = 0x0;
                        }
                }
 
                DEBUG(5,("api_net_srv_pwset: %d\n", __LINE__));
-#else
-               DEBUG(5,("api_net_srv_pwset: server password set being denied\n"));
-#endif
 
        }
        else
index ca4326f14e9fae0460879307b968a608e7f43307..8166021fc2dce6762f0e69f49a3be76f4425fa79 100644 (file)
@@ -4446,7 +4446,7 @@ struct smb_message_struct
    /* LANMAN2.0 PROTOCOL FOLLOWS */
    {SMBfindnclose, "SMBfindnclose", reply_findnclose, AS_USER},
    {SMBfindclose, "SMBfindclose", reply_findclose,AS_USER},
-   {SMBtrans2, "SMBtrans2", reply_trans2, AS_USER | QUEUE_IN_OPLOCK },
+   {SMBtrans2, "SMBtrans2", reply_trans2, AS_USER },
    {SMBtranss2, "SMBtranss2", reply_transs2, AS_USER},
 
    /* messaging routines */
index 165df56af50b314006374008f39b7707e72ee341..75cf18785cb84a9bbadbaf58d68182d6fe97bd21 100644 (file)
@@ -33,6 +33,7 @@ extern int Client;
 extern int oplock_sock;
 extern int smb_read_error;
 extern fstring local_machine;
+extern int global_oplock_break;
 
 /****************************************************************************
   Send the required number of replies back.
@@ -1743,6 +1744,19 @@ int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize)
   char *params = NULL, *data = NULL;
   int num_params, num_params_sofar, num_data, num_data_sofar;
 
+  if(global_oplock_break && (tran_call == TRANSACT2_OPEN))
+  {
+    /*
+     * Queue this open message as we are the process of an oplock break.
+     */
+
+    DEBUG(2,("%s: reply_trans2: queueing message trans2open due to being in oplock break state.\n",
+           timestring() ));
+
+    push_smb_message( inbuf, length);
+    return -1;
+  }
+
   outsize = set_message(outbuf,0,0,True);
 
   /* All trans2 messages we handle have smb_sucnt == 1 - ensure this