summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sharpe <realrichardsharpe@gmail.com>2015-03-24 07:16:26 -0700
committerJeremy Allison <jra@samba.org>2015-03-27 01:24:47 +0100
commitf0e9ba91c0610b038cb2c3d7a487e0d904855dc5 (patch)
tree0494690a143a7c38cb9ca966b1f43f0cc56bcfde
parent70d20da561088a04bf8d87f31771228a8ffccea8 (diff)
downloadsamba-f0e9ba91c0610b038cb2c3d7a487e0d904855dc5.tar.gz
Rename SMB2_OP_FIND to SMB2_OP_QUERY_DIRECTORY so that it conforms with the MS document MS-SMB2.
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
-rw-r--r--libcli/smb/smb2_constants.h38
-rw-r--r--libcli/smb/smb2cli_query_directory.c2
-rw-r--r--source3/smbd/globals.h2
-rw-r--r--source3/smbd/smb2_query_directory.c (renamed from source3/smbd/smb2_find.c)30
-rw-r--r--source3/smbd/smb2_server.c6
-rwxr-xr-xsource3/wscript_build2
-rw-r--r--source4/libcli/smb2/find.c2
-rw-r--r--source4/smb_server/smb2/receive.c2
8 files changed, 42 insertions, 42 deletions
diff --git a/libcli/smb/smb2_constants.h b/libcli/smb/smb2_constants.h
index 1a6c5ad16e0..baee847b10d 100644
--- a/libcli/smb/smb2_constants.h
+++ b/libcli/smb/smb2_constants.h
@@ -67,25 +67,25 @@
#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' */
diff --git a/libcli/smb/smb2cli_query_directory.c b/libcli/smb/smb2cli_query_directory.c
index bccc5294552..d1ccdb808e7 100644
--- a/libcli/smb/smb2cli_query_directory.c
+++ b/libcli/smb/smb2cli_query_directory.c
@@ -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,
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 7726c24b637..b52c6a99f64 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -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);
diff --git a/source3/smbd/smb2_find.c b/source3/smbd/smb2_query_directory.c
index 2dab86b5676..81f2e1772c5 100644
--- a/source3/smbd/smb2_find.c
+++ b/source3/smbd/smb2_query_directory.c
@@ -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);
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index d174fe69d92..8725ef2e958 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -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:
diff --git a/source3/wscript_build b/source3/wscript_build
index 8870e9f4e88..6fa59311fba 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -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
diff --git a/source4/libcli/smb2/find.c b/source4/libcli/smb2/find.c
index 2fb52a9f9fe..2e0bd35f102 100644
--- a/source4/libcli/smb2/find.c
+++ b/source4/libcli/smb2/find.c
@@ -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);
diff --git a/source4/smb_server/smb2/receive.c b/source4/smb_server/smb2/receive.c
index 19ab20b9413..9187310050c 100644
--- a/source4/smb_server/smb2/receive.c
+++ b/source4/smb_server/smb2/receive.c
@@ -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);