s3:smbd:smb2_create: add some comment
[metze/samba/wip.git] / source3 / smbd / smb2_create.c
index bb2d00ad5a460b001061d4ab4be3e0394ad6d040..28d50740ba44a210b4dc8902e0fb96ce4bc4ca3b 100644 (file)
@@ -465,6 +465,8 @@ static NTSTATUS smb2_create_durable_reconnect(struct smbXsrv_open *op,
        files_struct *fsp = NULL;
        NTSTATUS status;
 
+DEBUG(0, ("OBNOX - durable_reconnect enter: (%s:%s)\n", __location__, __FUNCTION__));
+
        /* 1. check entry in locking.tdb */
 
        /*
@@ -528,6 +530,8 @@ static NTSTATUS smb2_create_durable_reconnect(struct smbXsrv_open *op,
                return status;
        }
 
+DEBUG(0, ("OBNOX - durable_reconnect: new fsp created (%s:%s)\n", __location__, __FUNCTION__));
+
        fsp->fh->fd = SMB_VFS_OPEN(conn,
                                   smb_fname,
                                   fsp,
@@ -782,6 +786,8 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
                if (dhnc) {
                        uint64_t persistent_id;
 
+DEBUG(0, ("OBNOX - dhnc found (%s:%s)\n", __location__, __FUNCTION__));
+
                        if (dhnc->data.length != 16) {
                                tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
                                return tevent_req_post(req, ev);
@@ -885,8 +891,8 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
                                          smb1req->conn,
                                          smb1req->flags2 & FLAGS2_DFS_PATHNAMES,
                                          fname,
-                                         0,
-                                         NULL,
+                                         0,    /* unix_convert flags */
+                                         NULL, /* ppath_contains_wcards */
                                          &smb_fname);
                if (!NT_STATUS_IS_OK(status)) {
                        tevent_req_nterror(req, status);
@@ -906,15 +912,12 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
                                                               mem_ctx,
                                                               &result);
 
+DEBUG(0, ("OBNOX - durable_reconnect result: %s (%s:%s)\n", nt_errstr(status), __location__, __FUNCTION__));
+
                        if (!NT_STATUS_IS_OK(status)) {
                                tevent_req_nterror(req, status);
                                return tevent_req_post(req, ev);
                        }
-
-                       // TODO: response construction
-
-                       tevent_req_done(req);
-                       return tevent_req_post(req, ev);
                } else {
                        status = SMB_VFS_CREATE_FILE(smb1req->conn,
                                                     smb1req,
@@ -970,7 +973,12 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
                        }
                }
 
-               if (dhnq && BATCH_OPLOCK_TYPE(result->oplock_type)) {
+               /*
+                * windows createst a dhnc response blob upon dbnc request.
+                * this seems to contradict the documentation, though
+                * --> TODO:dochelp
+                */
+               if (dhnc || (dhnq && BATCH_OPLOCK_TYPE(result->oplock_type))) {
                        uint8_t p[8];
                        DATA_BLOB blob = data_blob_const(p, sizeof(p));