Author: vlendec
Date: 2005-07-16 09:56:05 +0000 (Sat, 16 Jul 2005)
New Revision: 8513

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

Log:
Feed Jeremy's paranoia -- back out the last patch :-)

Thanks,

Volker

Modified:
   trunk/source/include/smb.h
   trunk/source/smbd/oplock.c


Changeset:
Modified: trunk/source/include/smb.h
===================================================================
--- trunk/source/include/smb.h  2005-07-16 09:09:19 UTC (rev 8512)
+++ trunk/source/include/smb.h  2005-07-16 09:56:05 UTC (rev 8513)
@@ -1511,6 +1511,7 @@
 /* Message types */
 #define OPLOCK_BREAK_CMD 0x1
 #define KERNEL_OPLOCK_BREAK_CMD 0x2
+#define LEVEL_II_OPLOCK_BREAK_CMD 0x3
 #define ASYNC_LEVEL_II_OPLOCK_BREAK_CMD 0x4
 
 /* Add the "deferred open" message. */

Modified: trunk/source/smbd/oplock.c
===================================================================
--- trunk/source/smbd/oplock.c  2005-07-16 09:09:19 UTC (rev 8512)
+++ trunk/source/smbd/oplock.c  2005-07-16 09:56:05 UTC (rev 8513)
@@ -381,6 +381,7 @@
                        break;
 
                case OPLOCK_BREAK_CMD:
+               case LEVEL_II_OPLOCK_BREAK_CMD:
                case ASYNC_LEVEL_II_OPLOCK_BREAK_CMD:
 
                        /* Ensure that the msg length is correct. */
@@ -482,7 +483,8 @@
         * case.
         */
 
-       if (break_cmd_type != OPLOCK_BREAK_CMD) {
+       if (!((break_cmd_type == OPLOCK_BREAK_CMD) ||
+             (break_cmd_type == LEVEL_II_OPLOCK_BREAK_CMD))) {
                return True;
        }
 
@@ -995,6 +997,7 @@
        SMB_DEV_T dev = share_entry->dev;
        SMB_INO_T inode = share_entry->inode;
        unsigned long file_id = share_entry->share_file_id;
+       uint16 break_cmd_type;
 
        if(pid == share_entry->pid) {
                /* We are breaking our own oplock, make sure it's us. */
@@ -1024,7 +1027,13 @@
 
        /* We need to send a OPLOCK_BREAK_CMD message to the port in the share 
mode entry. */
 
-       SSVAL(op_break_msg,OPBRK_MESSAGE_CMD_OFFSET,OPLOCK_BREAK_CMD);
+       if (LEVEL_II_OPLOCK_TYPE(share_entry->op_type)) {
+               break_cmd_type = LEVEL_II_OPLOCK_BREAK_CMD;
+       } else {
+               break_cmd_type = OPLOCK_BREAK_CMD;
+       }
+
+       SSVAL(op_break_msg,OPBRK_MESSAGE_CMD_OFFSET,break_cmd_type);
        memcpy(op_break_msg+OPLOCK_BREAK_PID_OFFSET,(char *)&pid,sizeof(pid));
        memcpy(op_break_msg+OPLOCK_BREAK_DEV_OFFSET,(char *)&dev,sizeof(dev));
        memcpy(op_break_msg+OPLOCK_BREAK_INODE_OFFSET,(char 
*)&inode,sizeof(inode));
@@ -1110,7 +1119,7 @@
                 * Test to see if this is the reply we are awaiting (ie. the 
one we sent with the CMD_REPLY flag OR'ed in).
                 */
                if((SVAL(reply_msg_start,OPBRK_MESSAGE_CMD_OFFSET) & CMD_REPLY) 
&&
-                       ((SVAL(reply_msg_start,OPBRK_MESSAGE_CMD_OFFSET) & 
~CMD_REPLY) == OPLOCK_BREAK_CMD) &&
+                       ((SVAL(reply_msg_start,OPBRK_MESSAGE_CMD_OFFSET) & 
~CMD_REPLY) == break_cmd_type) &&
                        (reply_from_port == share_entry->op_port) && 
                        (memcmp(&reply_msg_start[OPLOCK_BREAK_PID_OFFSET], 
&op_break_msg[OPLOCK_BREAK_PID_OFFSET],
                                OPLOCK_BREAK_MSG_LEN - OPLOCK_BREAK_PID_OFFSET) 
== 0)) {

Reply via email to