]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
locking mask fixes from head branch
authorAndrew Tridgell <tridge@samba.org>
Mon, 7 Dec 1998 22:53:05 +0000 (22:53 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 7 Dec 1998 22:53:05 +0000 (22:53 +0000)
source/lib/util.c
source/smbd/open.c

index 58dbde7f2ae2de5bfc267d4adb6a1b74d343937d..671314094b29780d9420411c0b41113aa31ef982 100644 (file)
@@ -2554,8 +2554,8 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
   int ret;
 
   if(lp_ole_locking_compat()) {
-    SMB_OFF_T mask = ((SMB_OFF_T)0xC) << (SMB_OFF_T_BITS-4);
     SMB_OFF_T mask2= ((SMB_OFF_T)0x3) << (SMB_OFF_T_BITS-4);
+    SMB_OFF_T mask = (mask2<<2);
 
     /* make sure the count is reasonable, we might kill the lockd otherwise */
     count &= ~mask;
@@ -2567,7 +2567,8 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
     if ((offset & mask) != 0)
       offset = (offset & ~mask) | (((offset & mask) >> 2) & mask2);
   } else {
-    SMB_OFF_T mask = ((SMB_OFF_T)0x8) << (SMB_OFF_T_BITS-4);
+    SMB_OFF_T mask2 = ((SMB_OFF_T)0x4) << (SMB_OFF_T_BITS-4);
+    SMB_OFF_T mask = (mask2<<1);
     SMB_OFF_T neg_mask = ~mask;
 
     /* interpret negative counts as large numbers */
index dd1ece7fe13b56af6412f79c9b6c046d89772505..6658b8926f89f50a57f4604d3d7db60578bd0c43 100644 (file)
@@ -574,7 +574,8 @@ static void truncate_unless_locked(files_struct *fsp, connection_struct *conn, i
                                   BOOL *share_locked)
 {
        if (fsp->can_write){
-               SMB_OFF_T mask = ((SMB_OFF_T)0xC) << (SMB_OFF_T_BITS-4);
+               SMB_OFF_T mask2 = ((SMB_OFF_T)0x3) << (SMB_OFF_T_BITS-4);
+               SMB_OFF_T mask = (mask2<<2);
                
                if (is_locked(fsp,conn,~mask,0,F_WRLCK)){
                        /* If share modes are in force for this connection we