smb2_create_durable_reconnect: refetch the share mode entry with lock
authorMichael Adam <obnox@samba.org>
Mon, 13 Feb 2012 21:03:43 +0000 (22:03 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 10 May 2012 16:41:44 +0000 (18:41 +0200)
source3/smbd/smb2_create.c

index f5ade61cc1baabab946385d009c7b4ef69736165..8b1b8acc5392ad2176dbdaa5e7420680a599703c 100644 (file)
@@ -430,10 +430,19 @@ static NTSTATUS smb2_create_durable_reconnect(struct smbXsrv_open *op,
                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
        }
 
+       /* 2. proceed with opening file */
+
+       /*
+        * refetch with lock and update the pid
+        */
+       talloc_free(sharemode_lock);
+       sharemode_lock = get_share_mode_lock(mem_ctx,
+                                            op->global->backend_file_id);
+       if (sharemode_lock == NULL) {
+               return NT_STATUS_OBJECT_NAME_NOT_FOUND;
+       }
+
        /*
-        *
-        * - refetch with lock and update the pid
-        * - reopen the file with SMB_VFS_OPEN()
         * - build a files_struct
         * - release the sharemode lock
         * - update fsp pointer in smbXsrv_open
@@ -441,7 +450,6 @@ static NTSTATUS smb2_create_durable_reconnect(struct smbXsrv_open *op,
         *
         * ... think about seek()
         */
-       /* 2. proceed with opening file */
        return NT_STATUS_NOT_IMPLEMENTED;
 }