From 7bfe569b7d3cd0709c166ab484d600ff1e2ce580 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 6 Dec 2007 19:05:54 +0100 Subject: Allow to set level in cmd_wkssvc_wkstagetinfo(). Guenther (This used to be commit 2c287ce0507a019aaa4d8dec74bc5c515ec2e3c7) --- source3/rpcclient/cmd_wkssvc.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3') diff --git a/source3/rpcclient/cmd_wkssvc.c b/source3/rpcclient/cmd_wkssvc.c index f3ff8113e9..5873f17813 100644 --- a/source3/rpcclient/cmd_wkssvc.c +++ b/source3/rpcclient/cmd_wkssvc.c @@ -32,6 +32,15 @@ static WERROR cmd_wkssvc_wkstagetinfo(struct rpc_pipe_client *cli, union wkssvc_NetWkstaInfo info; const char *server_name; + if (argc > 2) { + printf("usage: %s \n", argv[0]); + return WERR_OK; + } + + if (argc > 1) { + level = atoi(argv[1]); + } + server_name = cli->cli->desthost; status = rpccli_wkssvc_NetWkstaGetInfo(cli, mem_ctx, -- cgit From 09c4b72a5730dc9c91d537632d3a9ca0a7c04c0b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 3 Dec 2007 13:12:26 +0100 Subject: Add getjoininformation to rpcclient. Guenther (This used to be commit 699f6b1bc332b1e2834f5c384440b2501838c43f) --- source3/rpcclient/cmd_wkssvc.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3') diff --git a/source3/rpcclient/cmd_wkssvc.c b/source3/rpcclient/cmd_wkssvc.c index 5873f17813..b0c548f925 100644 --- a/source3/rpcclient/cmd_wkssvc.c +++ b/source3/rpcclient/cmd_wkssvc.c @@ -55,9 +55,35 @@ static WERROR cmd_wkssvc_wkstagetinfo(struct rpc_pipe_client *cli, return werr; } +static WERROR cmd_wkssvc_getjoininformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + int argc, + const char **argv) +{ + const char *server_name; + const char *name_buffer; + enum wkssvc_NetJoinStatus name_type; + NTSTATUS status; + + server_name = cli->cli->desthost; + name_buffer = ""; + + status = rpccli_wkssvc_NetrGetJoinInformation(cli, mem_ctx, + server_name, &name_buffer, + &name_type); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } + + printf("%s (%d)\n", name_buffer, name_type); + + return WERR_OK; +} + struct cmd_set wkssvc_commands[] = { { "WKSSVC" }, { "wkstagetinfo", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_wkstagetinfo, PI_WKSSVC, NULL, "Query WKSSVC Workstation Information", "" }, + { "getjoininformation", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_getjoininformation, PI_WKSSVC, NULL, "Query WKSSVC Join Information", "" }, { NULL } }; -- cgit From 783afeb5fa563bcfd6635fd07076447f0c586dc5 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 6 Dec 2007 19:06:30 +0100 Subject: Add cmd_wkssvc_messagebuffersend(). Guenther (This used to be commit 71e512efabe833a850cce3ed827415b5d1c032d5) --- source3/rpcclient/cmd_wkssvc.c | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/rpcclient/cmd_wkssvc.c b/source3/rpcclient/cmd_wkssvc.c index b0c548f925..d32a4c591f 100644 --- a/source3/rpcclient/cmd_wkssvc.c +++ b/source3/rpcclient/cmd_wkssvc.c @@ -80,10 +80,45 @@ static WERROR cmd_wkssvc_getjoininformation(struct rpc_pipe_client *cli, return WERR_OK; } +static WERROR cmd_wkssvc_messagebuffersend(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + int argc, + const char **argv) +{ + const char *server_name = cli->cli->desthost; + const char *message_name = cli->cli->desthost; + const char *message_sender_name = cli->cli->desthost; + smb_ucs2_t *message_buffer = NULL; + size_t message_size = 0; + NTSTATUS status; + WERROR werr; + + message_size = push_ucs2_talloc(mem_ctx, + &message_buffer, + "my message"); + if (message_size == -1) { + return WERR_NOMEM; + } + + status = rpccli_wkssvc_NetrMessageBufferSend(cli, mem_ctx, + server_name, + message_name, + message_sender_name, + (uint8_t *)message_buffer, + message_size, + &werr); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } + + return werr; +} + struct cmd_set wkssvc_commands[] = { { "WKSSVC" }, - { "wkstagetinfo", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_wkstagetinfo, PI_WKSSVC, NULL, "Query WKSSVC Workstation Information", "" }, - { "getjoininformation", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_getjoininformation, PI_WKSSVC, NULL, "Query WKSSVC Join Information", "" }, + { "wkssvc_wkstagetinfo", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_wkstagetinfo, PI_WKSSVC, NULL, "Query WKSSVC Workstation Information", "" }, + { "wkssvc_getjoininformation", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_getjoininformation, PI_WKSSVC, NULL, "Query WKSSVC Join Information", "" }, + { "wkssvc_messagebuffersend", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_messagebuffersend, PI_WKSSVC, NULL, "Send WKSSVC message", "" }, { NULL } }; -- cgit From 61dbd449b8918e52d7de8011dec0cb5f79bb25c5 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 3 Dec 2007 22:12:31 +0100 Subject: Fix build with new werror based pidl rpc. Guenther (This used to be commit 0e8fdfac8a7754c105f01bd21816a7940c20e878) --- source3/rpcclient/cmd_wkssvc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source3') diff --git a/source3/rpcclient/cmd_wkssvc.c b/source3/rpcclient/cmd_wkssvc.c index d32a4c591f..44b77decd2 100644 --- a/source3/rpcclient/cmd_wkssvc.c +++ b/source3/rpcclient/cmd_wkssvc.c @@ -64,20 +64,25 @@ static WERROR cmd_wkssvc_getjoininformation(struct rpc_pipe_client *cli, const char *name_buffer; enum wkssvc_NetJoinStatus name_type; NTSTATUS status; + WERROR werr; server_name = cli->cli->desthost; name_buffer = ""; status = rpccli_wkssvc_NetrGetJoinInformation(cli, mem_ctx, - server_name, &name_buffer, - &name_type); + server_name, + &name_buffer, + &name_type, + &werr); if (!NT_STATUS_IS_OK(status)) { return ntstatus_to_werror(status); } - printf("%s (%d)\n", name_buffer, name_type); + if (W_ERROR_IS_OK(werr)) { + printf("%s (%d)\n", name_buffer, name_type); + } - return WERR_OK; + return werr; } static WERROR cmd_wkssvc_messagebuffersend(struct rpc_pipe_client *cli, -- cgit From b2fac35adf2821e20fc9e74287e9d171b258ab6e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 7 Dec 2007 11:56:48 +0100 Subject: Allow to set custom message in wkssvc messagebuffer. Guenther (This used to be commit 4c03cbdc816842f1d657fdc8499e3ad9a459f0d7) --- source3/rpcclient/cmd_wkssvc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/rpcclient/cmd_wkssvc.c b/source3/rpcclient/cmd_wkssvc.c index 44b77decd2..d136cd0d45 100644 --- a/source3/rpcclient/cmd_wkssvc.c +++ b/source3/rpcclient/cmd_wkssvc.c @@ -95,12 +95,17 @@ static WERROR cmd_wkssvc_messagebuffersend(struct rpc_pipe_client *cli, const char *message_sender_name = cli->cli->desthost; smb_ucs2_t *message_buffer = NULL; size_t message_size = 0; + const char *message = "my message"; NTSTATUS status; WERROR werr; + if (argc > 1) { + message = argv[1]; + } + message_size = push_ucs2_talloc(mem_ctx, &message_buffer, - "my message"); + message); if (message_size == -1) { return WERR_NOMEM; } -- cgit From bccadf83bb67d9f1c6b4ee21ed66b509eb15d2e9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 7 Dec 2007 09:20:45 +0100 Subject: Fix two unused variable warnings I know this will be overwritten by the next "make idl", but it just bugs me *now* :-) Volker (This used to be commit a0abb885214ed29659889e359aecb60fb6dec100) --- source3/librpc/gen_ndr/ndr_wkssvc.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3') diff --git a/source3/librpc/gen_ndr/ndr_wkssvc.c b/source3/librpc/gen_ndr/ndr_wkssvc.c index c3a1f706cd..3599fef352 100644 --- a/source3/librpc/gen_ndr/ndr_wkssvc.c +++ b/source3/librpc/gen_ndr/ndr_wkssvc.c @@ -8606,7 +8606,6 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus(struct ndr_pull *ndr TALLOC_CTX *_mem_save_unknown_0; TALLOC_CTX *_mem_save_num_ous_0; TALLOC_CTX *_mem_save_ous_1; - TALLOC_CTX *_mem_save_ous_2; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9488,7 +9487,6 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus2(struct ndr_pull *nd TALLOC_CTX *_mem_save_EncryptedPassword_0; TALLOC_CTX *_mem_save_num_ous_0; TALLOC_CTX *_mem_save_ous_1; - TALLOC_CTX *_mem_save_ous_2; if (flags & NDR_IN) { ZERO_STRUCT(r->out); -- cgit From 30d31a3f85399042cd7f337c85a261352dd31b09 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 7 Dec 2007 10:46:11 +0100 Subject: Make fname arg to create_file a "const char *" (This used to be commit da94b5f9e37f38880e8ca4c2c7f8de6838864321) --- source3/smbd/open.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'source3') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 66ceb8dac7..f4c3791b43 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2447,7 +2447,7 @@ static struct case_semantics_state *set_posix_case_semantics(TALLOC_CTX *mem_ctx NTSTATUS create_file(connection_struct *conn, struct smb_request *req, uint16_t root_dir_fid, - char *fname, + const char *fname, uint32_t flags, uint32_t access_mask, uint32_t file_attributes, @@ -2624,7 +2624,10 @@ NTSTATUS create_file(connection_struct *conn, } if ((req != NULL) && (req->flags2 & FLAGS2_DFS_PATHNAMES)) { - status = resolve_dfspath(talloc_tos(), conn, true, fname, &fname); + char *resolved_fname; + + status = resolve_dfspath(talloc_tos(), conn, true, fname, + &resolved_fname); if (!NT_STATUS_IS_OK(status)) { /* @@ -2635,6 +2638,7 @@ NTSTATUS create_file(connection_struct *conn, */ goto fail; } + fname = resolved_fname; } /* @@ -2646,10 +2650,15 @@ NTSTATUS create_file(connection_struct *conn, file_attributes &= ~FILE_FLAG_POSIX_SEMANTICS; } - status = unix_convert(talloc_tos(), conn, fname, False, &fname, NULL, - &sbuf); - if (!NT_STATUS_IS_OK(status)) { - goto fail; + { + char *converted_fname; + + status = unix_convert(talloc_tos(), conn, fname, False, + &converted_fname, NULL, &sbuf); + if (!NT_STATUS_IS_OK(status)) { + goto fail; + } + fname = converted_fname; } /* All file access must go through check_name() */ -- cgit From c55e44b6a7c8ca569010ddd7596ba05239c4d673 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 7 Dec 2007 11:58:40 +0100 Subject: Re-arrange create_file() parameters This changes them to be a bit closer to open_file_ntcreate and thus provides less surprises to developers (This used to be commit d000258b96b9bb714efdfe982947370a6dfb5d55) --- source3/smbd/nttrans.c | 8 ++++---- source3/smbd/open.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index fb85a67d0a..01ac1abeb0 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -498,8 +498,8 @@ void reply_ntcreate_and_X(connection_struct *conn, struct smb_request *req) } status = create_file(conn, req, root_dir_fid, fname, flags, - access_mask, file_attributes, share_access, - create_disposition, create_options, + access_mask, share_access, create_disposition, + create_options, file_attributes, allocation_size, NULL, NULL, &fsp, &info, &oplock_granted, &sbuf); @@ -942,8 +942,8 @@ static void call_nt_transact_create(connection_struct *conn, } status = create_file(conn, req, root_dir_fid, fname, flags, - access_mask, file_attributes, share_access, - create_disposition, create_options, + access_mask, share_access, create_disposition, + create_options, file_attributes, allocation_size, sd, ea_list, &fsp, &info, &oplock_granted, &sbuf); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index f4c3791b43..f555aeccb3 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2450,10 +2450,10 @@ NTSTATUS create_file(connection_struct *conn, const char *fname, uint32_t flags, uint32_t access_mask, - uint32_t file_attributes, uint32_t share_access, uint32_t create_disposition, uint32_t create_options, + uint32_t file_attributes, SMB_BIG_UINT allocation_size, struct security_descriptor *sd, struct ea_list *ea_list, -- cgit From ce535b4dd8c410d91f9c0fa2d1d973b4326af64d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 7 Dec 2007 12:39:30 +0100 Subject: More parameter shuffling (This used to be commit 8f70f691ffa3e171a73d04a1c867aa6fca4d4583) --- source3/smbd/nttrans.c | 8 ++++---- source3/smbd/open.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 01ac1abeb0..a8afd580b3 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -497,9 +497,9 @@ void reply_ntcreate_and_X(connection_struct *conn, struct smb_request *req) } } - status = create_file(conn, req, root_dir_fid, fname, flags, + status = create_file(conn, req, root_dir_fid, fname, access_mask, share_access, create_disposition, - create_options, file_attributes, + create_options, file_attributes, flags, allocation_size, NULL, NULL, &fsp, &info, &oplock_granted, &sbuf); @@ -941,9 +941,9 @@ static void call_nt_transact_create(connection_struct *conn, return; } - status = create_file(conn, req, root_dir_fid, fname, flags, + status = create_file(conn, req, root_dir_fid, fname, access_mask, share_access, create_disposition, - create_options, file_attributes, + create_options, file_attributes, flags, allocation_size, sd, ea_list, &fsp, &info, &oplock_granted, &sbuf); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index f555aeccb3..11dff4dfe5 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2448,12 +2448,12 @@ NTSTATUS create_file(connection_struct *conn, struct smb_request *req, uint16_t root_dir_fid, const char *fname, - uint32_t flags, uint32_t access_mask, uint32_t share_access, uint32_t create_disposition, uint32_t create_options, uint32_t file_attributes, + uint32_t flags, SMB_BIG_UINT allocation_size, struct security_descriptor *sd, struct ea_list *ea_list, -- cgit From ca4eee5bbe477af2abcdbed542c5e8f7ef5eb610 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 7 Dec 2007 12:57:11 +0100 Subject: Pass only internal oplock request values to create_file Other callers (e.g. reply_open_and_X) might have other ideas of the bit shuffling (This used to be commit 6a58d823e51ccc8efd6682005e367c9096abc993) --- source3/smbd/nttrans.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++--- source3/smbd/open.c | 47 ++++----------------------------- 2 files changed, 71 insertions(+), 46 deletions(-) (limited to 'source3') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index a8afd580b3..716f682c1a 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -433,6 +433,7 @@ void reply_ntcreate_and_X(connection_struct *conn, struct smb_request *req) struct timespec a_timespec; struct timespec m_timespec; NTSTATUS status; + int oplock_request; uint8_t oplock_granted = NO_OPLOCK_RETURN; TALLOC_CTX *ctx = talloc_tos(); @@ -497,11 +498,16 @@ void reply_ntcreate_and_X(connection_struct *conn, struct smb_request *req) } } + oplock_request = (flags & REQUEST_OPLOCK) ? EXCLUSIVE_OPLOCK : 0; + if (oplock_request) { + oplock_request |= (flags & REQUEST_BATCH_OPLOCK) + ? BATCH_OPLOCK : 0; + } + status = create_file(conn, req, root_dir_fid, fname, access_mask, share_access, create_disposition, create_options, file_attributes, flags, - allocation_size, NULL, NULL, - &fsp, &info, &oplock_granted, &sbuf); + allocation_size, NULL, NULL, &fsp, &info, &sbuf); if (!NT_STATUS_IS_OK(status)) { if (open_was_deferred(req->mid)) { @@ -519,6 +525,31 @@ void reply_ntcreate_and_X(connection_struct *conn, struct smb_request *req) return; } + /* + * If the caller set the extended oplock request bit + * and we granted one (by whatever means) - set the + * correct bit for extended oplock reply. + */ + + if (oplock_request && + (lp_fake_oplocks(SNUM(conn)) + || EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type))) { + + /* + * Exclusive oplock granted + */ + + if (flags & REQUEST_BATCH_OPLOCK) { + oplock_granted = BATCH_OPLOCK_RETURN; + } else { + oplock_granted = EXCLUSIVE_OPLOCK_RETURN; + } + } else if (fsp->oplock_type == LEVEL_II_OPLOCK) { + oplock_granted = LEVEL_II_OPLOCK_RETURN; + } else { + oplock_granted = NO_OPLOCK_RETURN; + } + file_len = sbuf.st_size; fattr = dos_mode(conn,fname,&sbuf); if (fattr == 0) { @@ -834,6 +865,7 @@ static void call_nt_transact_create(connection_struct *conn, NTSTATUS status; size_t param_len; SMB_BIG_UINT allocation_size; + int oplock_request; uint8_t oplock_granted; TALLOC_CTX *ctx = talloc_tos(); @@ -941,11 +973,16 @@ static void call_nt_transact_create(connection_struct *conn, return; } + oplock_request = (flags & REQUEST_OPLOCK) ? EXCLUSIVE_OPLOCK : 0; + if (oplock_request) { + oplock_request |= (flags & REQUEST_BATCH_OPLOCK) + ? BATCH_OPLOCK : 0; + } + status = create_file(conn, req, root_dir_fid, fname, access_mask, share_access, create_disposition, create_options, file_attributes, flags, - allocation_size, sd, ea_list, - &fsp, &info, &oplock_granted, &sbuf); + allocation_size, sd, ea_list, &fsp, &info, &sbuf); if(!NT_STATUS_IS_OK(status)) { if (open_was_deferred(req->mid)) { @@ -961,6 +998,31 @@ static void call_nt_transact_create(connection_struct *conn, return; } + /* + * If the caller set the extended oplock request bit + * and we granted one (by whatever means) - set the + * correct bit for extended oplock reply. + */ + + if (oplock_request && + (lp_fake_oplocks(SNUM(conn)) + || EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type))) { + + /* + * Exclusive oplock granted + */ + + if (flags & REQUEST_BATCH_OPLOCK) { + oplock_granted = BATCH_OPLOCK_RETURN; + } else { + oplock_granted = EXCLUSIVE_OPLOCK_RETURN; + } + } else if (fsp->oplock_type == LEVEL_II_OPLOCK) { + oplock_granted = LEVEL_II_OPLOCK_RETURN; + } else { + oplock_granted = NO_OPLOCK_RETURN; + } + file_len = sbuf.st_size; fattr = dos_mode(conn,fname,&sbuf); if (fattr == 0) { diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 11dff4dfe5..b156dbbce1 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2453,14 +2453,13 @@ NTSTATUS create_file(connection_struct *conn, uint32_t create_disposition, uint32_t create_options, uint32_t file_attributes, - uint32_t flags, + uint32_t oplock_request, SMB_BIG_UINT allocation_size, struct security_descriptor *sd, struct ea_list *ea_list, files_struct **result, int *pinfo, - uint8_t *poplock_granted, SMB_STRUCT_STAT *psbuf) { TALLOC_CTX *frame = talloc_stackframe(); @@ -2468,21 +2467,20 @@ NTSTATUS create_file(connection_struct *conn, SMB_STRUCT_STAT sbuf; int info = FILE_WAS_OPENED; files_struct *fsp = NULL; - uint8_t oplock_granted = NO_OPLOCK_RETURN; - int oplock_request; NTSTATUS status; - DEBUG(10,("create_file: flags = 0x%x, access_mask = 0x%x " + DEBUG(10,("create_file: access_mask = 0x%x " "file_attributes = 0x%x, share_access = 0x%x, " "create_disposition = 0x%x create_options = 0x%x " + "oplock_request = 0x%x " "root_dir_fid = 0x%x, ea_list = 0x%p, sd = 0x%p, " "fname = %s\n", - (unsigned int)flags, (unsigned int)access_mask, (unsigned int)file_attributes, (unsigned int)share_access, (unsigned int)create_disposition, (unsigned int)create_options, + (unsigned int)oplock_request, (unsigned int)root_dir_fid, ea_list, sd, fname)); @@ -2613,12 +2611,6 @@ NTSTATUS create_file(connection_struct *conn, } } - oplock_request = (flags & REQUEST_OPLOCK) ? EXCLUSIVE_OPLOCK : 0; - if (oplock_request) { - oplock_request |= (flags & REQUEST_BATCH_OPLOCK) - ? BATCH_OPLOCK : 0; - } - if (req == NULL) { oplock_request |= INTERNAL_OPEN_ONLY; } @@ -2835,42 +2827,13 @@ NTSTATUS create_file(connection_struct *conn, } } - /* - * If the caller set the extended oplock request bit - * and we granted one (by whatever means) - set the - * correct bit for extended oplock reply. - */ - - if (oplock_request && - (lp_fake_oplocks(SNUM(conn)) - || EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type))) { - - /* - * Exclusive oplock granted - */ - - if (flags & REQUEST_BATCH_OPLOCK) { - oplock_granted = BATCH_OPLOCK_RETURN; - } else { - oplock_granted = EXCLUSIVE_OPLOCK_RETURN; - } - } else if (fsp->oplock_type == LEVEL_II_OPLOCK) { - oplock_granted = LEVEL_II_OPLOCK_RETURN; - } else { - oplock_granted = NO_OPLOCK_RETURN; - } - done: - DEBUG(10, ("create_file: info=%d, oplock_granted=%d\n", - info, (int)oplock_granted)); + DEBUG(10, ("create_file: info=%d\n", info)); *result = fsp; if (pinfo != NULL) { *pinfo = info; } - if (poplock_granted != NULL) { - *poplock_granted = oplock_granted; - } if (psbuf != NULL) { *psbuf = sbuf; } -- cgit From a23d09081fdb089c776e568418cba75c2c2e8271 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 7 Dec 2007 15:55:57 +0100 Subject: Attempt to fix make test :-) (This used to be commit de3a3e3745e58cbfa777ae426e38bad3d74230d4) --- source3/smbd/nttrans.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 716f682c1a..99b2bf65bb 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -506,7 +506,7 @@ void reply_ntcreate_and_X(connection_struct *conn, struct smb_request *req) status = create_file(conn, req, root_dir_fid, fname, access_mask, share_access, create_disposition, - create_options, file_attributes, flags, + create_options, file_attributes, oplock_request, allocation_size, NULL, NULL, &fsp, &info, &sbuf); if (!NT_STATUS_IS_OK(status)) { @@ -981,7 +981,7 @@ static void call_nt_transact_create(connection_struct *conn, status = create_file(conn, req, root_dir_fid, fname, access_mask, share_access, create_disposition, - create_options, file_attributes, flags, + create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, &fsp, &info, &sbuf); if(!NT_STATUS_IS_OK(status)) { -- cgit From d3b4b69a270efd85728ac77fe23a0fb39d9dce10 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 7 Dec 2007 16:19:34 +0100 Subject: Add NT_STATUS_DOWNGRADE_DETECTED (thanks to Magnus Mertens). Guenther (This used to be commit 970daaa0a620d8e47475909cd7b5e54869602530) --- source3/include/nterr.h | 1 + source3/libsmb/nterr.c | 1 + 2 files changed, 2 insertions(+) (limited to 'source3') diff --git a/source3/include/nterr.h b/source3/include/nterr.h index da9fab3aca..5749c4efbf 100644 --- a/source3/include/nterr.h +++ b/source3/include/nterr.h @@ -563,6 +563,7 @@ #define NT_STATUS_FILE_IS_OFFLINE NT_STATUS(0xC0000000 | 0x0267) #define NT_STATUS_DS_NO_MORE_RIDS NT_STATUS(0xC0000000 | 0x02a8) #define NT_STATUS_NOT_A_REPARSE_POINT NT_STATUS(0xC0000000 | 0x0275) +#define NT_STATUS_DOWNGRADE_DETECTED NT_STATUS(0xC0000000 | 0x0388) #define NT_STATUS_NO_SUCH_JOB NT_STATUS(0xC0000000 | 0xEDE) /* scheduler */ #define NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED NT_STATUS(0xC0000000 | 0x20004) diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index cf443f2339..608fe9db20 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -534,6 +534,7 @@ static const nt_err_code_struct nt_errs[] = { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, { "NT_STATUS_DS_NO_MORE_RIDS", NT_STATUS_DS_NO_MORE_RIDS }, { "NT_STATUS_NOT_A_REPARSE_POINT", NT_STATUS_NOT_A_REPARSE_POINT }, + { "NT_STATUS_DOWNGRADE_DETECTED", NT_STATUS_DOWNGRADE_DETECTED }, { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES }, { "STATUS_MORE_ENTRIES", STATUS_MORE_ENTRIES }, { "STATUS_SOME_UNMAPPED", STATUS_SOME_UNMAPPED }, -- cgit