Fixed bug in previous commit where I was overwriting share_mode from
authorJeremy Allison <jra@samba.org>
Fri, 23 Oct 1998 03:41:11 +0000 (03:41 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 23 Oct 1998 03:41:11 +0000 (03:41 +0000)
one fsp with that of another. Not good :-).
Jeremy.
(This used to be commit 269bca2b3bbf5cae9fdf05d0405bfd80272da5d1)

source3/smbd/trans2.c

index 1c2bdb1ddfac91d2e5e3509557293b05b1dade4d..e19b3a94a8f4b668a79b9ad6573c6df7c0083649 100644 (file)
@@ -1681,9 +1681,6 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
           files_struct *iterate_fsp;
           SMB_DEV_T dev = fsp->fd_ptr->dev;
           SMB_INO_T inode = fsp->fd_ptr->inode;
-          int new_share_mode = (delete_on_close ? 
-                                  (fsp->share_mode | DELETE_ON_CLOSE_FLAG) :
-                                  (fsp->share_mode & ~DELETE_ON_CLOSE_FLAG) );
 
           DEBUG(10,("call_trans2setfilepathinfo: %s delete on close flag for fnum = %d, file %s\n",
                delete_on_close ? "Adding" : "Removing", fsp->fnum, fsp->fsp_name ));
@@ -1699,6 +1696,10 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
           for(iterate_fsp = file_find_di_first(dev, inode); iterate_fsp;
                                 iterate_fsp = file_find_di_next(iterate_fsp))
           {
+            int new_share_mode = (delete_on_close ? 
+                                  (iterate_fsp->share_mode | DELETE_ON_CLOSE_FLAG) :
+                                  (iterate_fsp->share_mode & ~DELETE_ON_CLOSE_FLAG) );
+
             if(modify_share_mode(token, iterate_fsp, new_share_mode)==False)
               DEBUG(0,("call_trans2setfilepathinfo: failed to change delete on close for fnum %d, \
 dev = %x, inode = %.0f\n", fsp->fnum, (unsigned int)dev, (double)inode));