s3:libsmb: Plumb cli_smb2_create_fnum() inside cli_ntcreate().
authorJeremy Allison <jra@samba.org>
Wed, 7 Aug 2013 23:06:19 +0000 (16:06 -0700)
committerStefan Metzmacher <metze@samba.org>
Thu, 15 Aug 2013 07:07:06 +0000 (09:07 +0200)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/libsmb/clifile.c

index d63734d3f7463f8edb88e44e4ca242a7b7029465..3c799a68a334748b461789638c8de7834d159653 100644 (file)
@@ -1914,11 +1914,26 @@ NTSTATUS cli_ntcreate(struct cli_state *cli,
                      uint8_t SecurityFlags,
                      uint16_t *pfid)
 {
-       TALLOC_CTX *frame = talloc_stackframe();
+       TALLOC_CTX *frame = NULL;
        struct tevent_context *ev;
        struct tevent_req *req;
        NTSTATUS status = NT_STATUS_OK;
 
+       if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
+               return cli_smb2_create_fnum(cli,
+                                       fname,
+                                       CreatFlags,
+                                       DesiredAccess,
+                                       FileAttributes,
+                                       ShareAccess,
+                                       CreateDisposition,
+                                       CreateOptions,
+                                       pfid,
+                                       NULL);
+       }
+
+       frame = talloc_stackframe();
+
        if (smbXcli_conn_has_async_calls(cli->conn)) {
                /*
                 * Can't use sync call while an async call is in flight