Rename SMB2_OP_FIND to SMB2_OP_QUERY_DIRECTORY so that it conforms with the MS docume...
authorRichard Sharpe <realrichardsharpe@gmail.com>
Tue, 24 Mar 2015 14:16:26 +0000 (07:16 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 27 Mar 2015 00:24:47 +0000 (01:24 +0100)
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 27 01:24:47 CET 2015 on sn-devel-104

libcli/smb/smb2_constants.h
libcli/smb/smb2cli_query_directory.c
source3/smbd/globals.h
source3/smbd/smb2_query_directory.c [moved from source3/smbd/smb2_find.c with 93% similarity]
source3/smbd/smb2_server.c
source3/wscript_build
source4/libcli/smb2/find.c
source4/smb_server/smb2/receive.c

index 1a6c5ad16e0891a8c0bc4bf8a7088e7a2ef299d8..baee847b10d8a74f527985a45115fb784cd92855 100644 (file)
 #define SMB2_HDR_FLAG_REPLAY_OPERATION 0x20000000
 
 /* SMB2 opcodes */
-#define SMB2_OP_NEGPROT   0x00
-#define SMB2_OP_SESSSETUP 0x01
-#define SMB2_OP_LOGOFF    0x02
-#define SMB2_OP_TCON      0x03
-#define SMB2_OP_TDIS      0x04
-#define SMB2_OP_CREATE    0x05
-#define SMB2_OP_CLOSE     0x06
-#define SMB2_OP_FLUSH     0x07
-#define SMB2_OP_READ      0x08
-#define SMB2_OP_WRITE     0x09
-#define SMB2_OP_LOCK      0x0a
-#define SMB2_OP_IOCTL     0x0b
-#define SMB2_OP_CANCEL    0x0c
-#define SMB2_OP_KEEPALIVE 0x0d
-#define SMB2_OP_FIND      0x0e
-#define SMB2_OP_NOTIFY    0x0f
-#define SMB2_OP_GETINFO   0x10
-#define SMB2_OP_SETINFO   0x11
-#define SMB2_OP_BREAK     0x12
+#define SMB2_OP_NEGPROT                0x00
+#define SMB2_OP_SESSSETUP      0x01
+#define SMB2_OP_LOGOFF         0x02
+#define SMB2_OP_TCON           0x03
+#define SMB2_OP_TDIS           0x04
+#define SMB2_OP_CREATE         0x05
+#define SMB2_OP_CLOSE          0x06
+#define SMB2_OP_FLUSH          0x07
+#define SMB2_OP_READ           0x08
+#define SMB2_OP_WRITE          0x09
+#define SMB2_OP_LOCK           0x0a
+#define SMB2_OP_IOCTL          0x0b
+#define SMB2_OP_CANCEL         0x0c
+#define SMB2_OP_KEEPALIVE      0x0d
+#define SMB2_OP_QUERY_DIRECTORY        0x0e
+#define SMB2_OP_NOTIFY         0x0f
+#define SMB2_OP_GETINFO                0x10
+#define SMB2_OP_SETINFO                0x11
+#define SMB2_OP_BREAK          0x12
 
 #define SMB2_MAGIC 0x424D53FE /* 0xFE 'S' 'M' 'B' */
 
index bccc52945520c211a7bc5deebb7f6b62c6d656b0..d1ccdb808e7a9ba12c92a918ff1917004a889093 100644 (file)
@@ -87,7 +87,7 @@ struct tevent_req *smb2cli_query_directory_send(TALLOC_CTX *mem_ctx,
                dyn_len = sizeof(state->dyn_pad);
        }
 
-       subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_FIND,
+       subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_QUERY_DIRECTORY,
                                  0, 0, /* flags */
                                  timeout_msec,
                                  tcon,
index 7726c24b63737738623175cb19f6a6c0cd00bb0f..b52c6a99f649a2bc70f9049909ad1721ca69d1f2 100644 (file)
@@ -292,7 +292,7 @@ NTSTATUS smb2_write_complete_nosync(struct tevent_req *req, ssize_t nwritten,
 NTSTATUS smbd_smb2_request_process_lock(struct smbd_smb2_request *req);
 NTSTATUS smbd_smb2_request_process_ioctl(struct smbd_smb2_request *req);
 NTSTATUS smbd_smb2_request_process_keepalive(struct smbd_smb2_request *req);
-NTSTATUS smbd_smb2_request_process_find(struct smbd_smb2_request *req);
+NTSTATUS smbd_smb2_request_process_query_directory(struct smbd_smb2_request *req);
 NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req);
 NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req);
 NTSTATUS smbd_smb2_request_process_setinfo(struct smbd_smb2_request *req);
similarity index 93%
rename from source3/smbd/smb2_find.c
rename to source3/smbd/smb2_query_directory.c
index 2dab86b5676b535fd7f1a52d0d52033419b2075e..81f2e1772c53344be5af273f046f7b1336990ce2 100644 (file)
@@ -25,7 +25,7 @@
 #include "trans2.h"
 #include "../lib/util/tevent_ntstatus.h"
 
-static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
+static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
                                              struct tevent_context *ev,
                                              struct smbd_smb2_request *smb2req,
                                              struct files_struct *in_fsp,
@@ -34,12 +34,12 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
                                              uint32_t in_file_index,
                                              uint32_t in_output_buffer_length,
                                              const char *in_file_name);
-static NTSTATUS smbd_smb2_find_recv(struct tevent_req *req,
+static NTSTATUS smbd_smb2_query_directory_recv(struct tevent_req *req,
                                    TALLOC_CTX *mem_ctx,
                                    DATA_BLOB *out_output_buffer);
 
 static void smbd_smb2_request_find_done(struct tevent_req *subreq);
-NTSTATUS smbd_smb2_request_process_find(struct smbd_smb2_request *req)
+NTSTATUS smbd_smb2_request_process_query_directory(struct smbd_smb2_request *req)
 {
        NTSTATUS status;
        const uint8_t *inbody;
@@ -120,7 +120,7 @@ NTSTATUS smbd_smb2_request_process_find(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
        }
 
-       subreq = smbd_smb2_find_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_query_directory_send(req, req->sconn->ev_ctx,
                                     req, in_fsp,
                                     in_file_info_class,
                                     in_flags,
@@ -146,7 +146,7 @@ static void smbd_smb2_request_find_done(struct tevent_req *subreq)
        NTSTATUS status;
        NTSTATUS error; /* transport error */
 
-       status = smbd_smb2_find_recv(subreq,
+       status = smbd_smb2_query_directory_recv(subreq,
                                     req,
                                     &out_output_buffer);
        TALLOC_FREE(subreq);
@@ -192,12 +192,12 @@ static void smbd_smb2_request_find_done(struct tevent_req *subreq)
        }
 }
 
-struct smbd_smb2_find_state {
+struct smbd_smb2_query_directory_state {
        struct smbd_smb2_request *smb2req;
        DATA_BLOB out_output_buffer;
 };
 
-static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
+static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
                                              struct tevent_context *ev,
                                              struct smbd_smb2_request *smb2req,
                                              struct files_struct *fsp,
@@ -209,7 +209,7 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
 {
        struct smbXsrv_connection *xconn = smb2req->xconn;
        struct tevent_req *req;
-       struct smbd_smb2_find_state *state;
+       struct smbd_smb2_query_directory_state *state;
        struct smb_request *smbreq;
        connection_struct *conn = smb2req->tcon->compat;
        NTSTATUS status;
@@ -230,14 +230,14 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
        char *p;
 
        req = tevent_req_create(mem_ctx, &state,
-                               struct smbd_smb2_find_state);
+                               struct smbd_smb2_query_directory_state);
        if (req == NULL) {
                return NULL;
        }
        state->smb2req = smb2req;
        state->out_output_buffer = data_blob_null;
 
-       DEBUG(10,("smbd_smb2_find_send: %s - %s\n",
+       DEBUG(10,("smbd_smb2_query_directory_send: %s - %s\n",
                  fsp_str_dbg(fsp), fsp_fnum_dbg(fsp)));
 
        smbreq = smbd_smb2_fake_smb_request(smb2req);
@@ -275,7 +275,7 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
        }
 
        if (in_output_buffer_length > xconn->smb2.server.max_trans) {
-               DEBUG(2,("smbd_smb2_find_send: "
+               DEBUG(2,("smbd_smb2_query_directory_send: "
                         "client ignored max trans:%s: 0x%08X: 0x%08X\n",
                         __location__, in_output_buffer_length,
                         xconn->smb2.server.max_trans));
@@ -418,7 +418,7 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
        off = 0;
        num = 0;
 
-       DEBUG(8,("smbd_smb2_find_send: dirpath=<%s> dontdescend=<%s>, "
+       DEBUG(8,("smbd_smb2_query_directory_send: dirpath=<%s> dontdescend=<%s>, "
                "in_output_buffer_length = %u\n",
                fsp->fsp_name->base_name, lp_dont_descend(talloc_tos(), SNUM(conn)),
                (unsigned int)in_output_buffer_length ));
@@ -495,13 +495,13 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
        return tevent_req_post(req, ev);
 }
 
-static NTSTATUS smbd_smb2_find_recv(struct tevent_req *req,
+static NTSTATUS smbd_smb2_query_directory_recv(struct tevent_req *req,
                                    TALLOC_CTX *mem_ctx,
                                    DATA_BLOB *out_output_buffer)
 {
        NTSTATUS status;
-       struct smbd_smb2_find_state *state = tevent_req_data(req,
-                                            struct smbd_smb2_find_state);
+       struct smbd_smb2_query_directory_state *state = tevent_req_data(req,
+                                            struct smbd_smb2_query_directory_state);
 
        if (tevent_req_is_nterror(req, &status)) {
                tevent_req_received(req);
index d174fe69d923baf6210b26976f81e50f4b84fa11..8725ef2e95871afbe2596b23c50438d5e765fcd9 100644 (file)
@@ -115,7 +115,7 @@ static const struct smbd_smb2_dispatch_table {
                _OP(SMB2_OP_KEEPALIVE),
                .as_root = true,
        },{
-               _OP(SMB2_OP_FIND),
+               _OP(SMB2_OP_QUERY_DIRECTORY),
                .need_session = true,
                .need_tcon = true,
                .fileid_ofs = 0x08,
@@ -2307,10 +2307,10 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
                return_value = smbd_smb2_request_process_keepalive(req);
                break;
 
-       case SMB2_OP_FIND:
+       case SMB2_OP_QUERY_DIRECTORY:
                SMBPROFILE_IOBYTES_ASYNC_START(smb2_find, profile_p,
                                               req->profile, _INBYTES(req));
-               return_value = smbd_smb2_request_process_find(req);
+               return_value = smbd_smb2_request_process_query_directory(req);
                break;
 
        case SMB2_OP_NOTIFY:
index 8870e9f4e88f877f55e1685f4b3f3154366b29d7..6fa59311fbac487225262dd0493bdc63c4b5ca70 100755 (executable)
@@ -583,7 +583,7 @@ bld.SAMBA3_LIBRARY('smbd_base',
                    smbd/smb2_ioctl_named_pipe.c
                    smbd/smb2_ioctl_network_fs.c
                    smbd/smb2_keepalive.c
-                   smbd/smb2_find.c
+                   smbd/smb2_query_directory.c
                    smbd/smb2_notify.c
                    smbd/smb2_getinfo.c
                    smbd/smb2_setinfo.c
index 2fb52a9f9fe5d31090e15bf56141b427eab696fc..2e0bd35f102e9623e9f2e9c89c15473f6b04888f 100644 (file)
@@ -33,7 +33,7 @@ struct smb2_request *smb2_find_send(struct smb2_tree *tree, struct smb2_find *io
        struct smb2_request *req;
        NTSTATUS status;
 
-       req = smb2_request_init_tree(tree, SMB2_OP_FIND, 0x20, true, 0);
+       req = smb2_request_init_tree(tree, SMB2_OP_QUERY_DIRECTORY, 0x20, true, 0);
        if (req == NULL) return NULL;
 
        SCVAL(req->out.body, 0x02, io->in.level);
index 19ab20b94131499222494a82429f3f09625f6aa3..9187310050ca74f21ec5cc63cae930ce71acc655 100644 (file)
@@ -452,7 +452,7 @@ static NTSTATUS smb2srv_reply(struct smb2srv_request *req)
        case SMB2_OP_KEEPALIVE:
                smb2srv_keepalive_recv(req);
                return NT_STATUS_OK;
-       case SMB2_OP_FIND:
+       case SMB2_OP_QUERY_DIRECTORY:
                if (!req->session) goto nosession;
                if (!req->tcon) goto notcon;
                smb2srv_find_recv(req);