summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-12-05 15:34:07 +0100
committerVolker Lendecke <vl@sernet.de>2007-12-05 15:47:32 +0100
commitb2ca9253e9a1e394a5fc1c550d1b30e4853dc43b (patch)
treebafe1837ce73ebcbea77d609b6e8576778274f95 /source3/smbd
parent195d6be38d9d721837a8d44ff918829528059cda (diff)
downloadsamba-b2ca9253e9a1e394a5fc1c550d1b30e4853dc43b.tar.gz
samba-b2ca9253e9a1e394a5fc1c550d1b30e4853dc43b.tar.bz2
samba-b2ca9253e9a1e394a5fc1c550d1b30e4853dc43b.zip
There's no point in passing down a 0
(This used to be commit 525a6887afcae8d8e740cf194a412c21da899649)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/nttrans.c6
-rw-r--r--source3/smbd/open.c40
2 files changed, 27 insertions, 19 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 8a177c8e76..fb85a67d0a 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -423,7 +423,6 @@ void reply_ntcreate_and_X(connection_struct *conn, struct smb_request *req)
SMB_BIG_UINT allocation_size;
/* Breakout the oplock request bits so we can set the
reply bits separately. */
- int oplock_request = 0;
uint32 fattr=0;
SMB_OFF_T file_len = 0;
SMB_STRUCT_STAT sbuf;
@@ -501,7 +500,7 @@ 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,
- oplock_request, allocation_size, NULL, NULL,
+ allocation_size, NULL, NULL,
&fsp, &info, &oplock_granted, &sbuf);
if (!NT_STATUS_IS_OK(status)) {
@@ -812,7 +811,6 @@ static void call_nt_transact_create(connection_struct *conn,
char *params = *ppparams;
char *data = *ppdata;
/* Breakout the oplock request bits so we can set the reply bits separately. */
- int oplock_request = 0;
uint32 fattr=0;
SMB_OFF_T file_len = 0;
SMB_STRUCT_STAT sbuf;
@@ -946,7 +944,7 @@ 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,
- oplock_request, allocation_size, sd, ea_list,
+ allocation_size, sd, ea_list,
&fsp, &info, &oplock_granted, &sbuf);
if(!NT_STATUS_IS_OK(status)) {
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 0a142cd416..66ceb8dac7 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2454,7 +2454,6 @@ NTSTATUS create_file(connection_struct *conn,
uint32_t share_access,
uint32_t create_disposition,
uint32_t create_options,
- int oplock_request,
SMB_BIG_UINT allocation_size,
struct security_descriptor *sd,
struct ea_list *ea_list,
@@ -2470,6 +2469,7 @@ NTSTATUS create_file(connection_struct *conn,
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 "
@@ -2619,18 +2619,22 @@ NTSTATUS create_file(connection_struct *conn,
? BATCH_OPLOCK : 0;
}
- status = resolve_dfspath(
- talloc_tos(), conn, req->flags2 & FLAGS2_DFS_PATHNAMES,
- fname, &fname);
+ if (req == NULL) {
+ oplock_request |= INTERNAL_OPEN_ONLY;
+ }
- if (!NT_STATUS_IS_OK(status)) {
- /*
- * For PATH_NOT_COVERED we had
- * reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
- * ERRSRV, ERRbadpath);
- * Need to fix in callers
- */
- goto fail;
+ if ((req != NULL) && (req->flags2 & FLAGS2_DFS_PATHNAMES)) {
+ status = resolve_dfspath(talloc_tos(), conn, true, fname, &fname);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ /*
+ * For PATH_NOT_COVERED we had
+ * reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
+ * ERRSRV, ERRbadpath);
+ * Need to fix in callers
+ */
+ goto fail;
+ }
}
/*
@@ -2852,9 +2856,15 @@ NTSTATUS create_file(connection_struct *conn,
info, (int)oplock_granted));
*result = fsp;
- *pinfo = info;
- *poplock_granted = oplock_granted;
- *psbuf = sbuf;
+ if (pinfo != NULL) {
+ *pinfo = info;
+ }
+ if (poplock_granted != NULL) {
+ *poplock_granted = oplock_granted;
+ }
+ if (psbuf != NULL) {
+ *psbuf = sbuf;
+ }
TALLOC_FREE(frame);
return NT_STATUS_OK;