summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-03-07 14:25:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:27 -0500
commit062a22be47261d6a447e66f96a4988be1fe2dd20 (patch)
tree9a5eba2f403f04cf53ef7de0341ea3abaa876722
parent5309fd6d13082767c6ac059d911808897f938a0f (diff)
downloadsamba-062a22be47261d6a447e66f96a4988be1fe2dd20.tar.gz
samba-062a22be47261d6a447e66f96a4988be1fe2dd20.tar.bz2
samba-062a22be47261d6a447e66f96a4988be1fe2dd20.zip
r21748: More cosmetic alignment. One change to call_nt_transact_create(): We were
asking open_file_ntcreate for a batch oplock if the client asked us to do so, even if it did not ask for an oplock in the first place. Did not test it, but I think this is bogus anyway. Volker (This used to be commit 0b94af112b9a40171fd9b14ea39981ac65d709f2)
-rw-r--r--source3/smbd/nttrans.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index de3863eabe..19989d2178 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -491,7 +491,9 @@ int reply_ntcreate_and_X(connection_struct *conn,
(unsigned int)create_options,
(unsigned int)root_dir_fid ));
- /* If it's an IPC, use the pipe handler. */
+ /*
+ * If it's an IPC, use the pipe handler.
+ */
if (IS_IPC(conn)) {
if (lp_nt_pipe_support()) {
@@ -669,14 +671,14 @@ int reply_ntcreate_and_X(connection_struct *conn,
*/
if(create_options & FILE_DIRECTORY_FILE) {
- oplock_request = 0;
-
+
/* Can't open a temp directory. IFS kit test. */
if (file_attributes & FILE_ATTRIBUTE_TEMPORARY) {
END_PROFILE(SMBntcreateX);
return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
}
+ oplock_request = 0;
status = open_directory(conn, fname, &sbuf,
access_mask,
share_access,
@@ -723,6 +725,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
new_file_attributes,
oplock_request,
&info, &fsp);
+
if (!NT_STATUS_IS_OK(status)) {
/* We cheat here. There are two cases we
* care about. One is a directory rename,
@@ -775,7 +778,6 @@ int reply_ntcreate_and_X(connection_struct *conn,
return ERROR_NT(status);
}
} else {
-
restore_case_semantics(conn, file_attributes);
END_PROFILE(SMBntcreateX);
if (open_was_deferred(SVAL(inbuf,smb_mid))) {
@@ -788,7 +790,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
}
restore_case_semantics(conn, file_attributes);
-
+
file_len = sbuf.st_size;
fattr = dos_mode(conn,fname,&sbuf);
if(fattr == 0) {
@@ -873,8 +875,8 @@ int reply_ntcreate_and_X(connection_struct *conn,
SIVAL(p,0,info);
}
p += 4;
-
- /* Create time. */
+
+ /* Create time. */
c_timespec = get_create_timespec(&sbuf,lp_fake_dir_create_times(SNUM(conn)));
a_timespec = get_atimespec(&sbuf);
m_timespec = get_mtimespec(&sbuf);
@@ -885,7 +887,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
dos_filetime_timespec(&m_timespec);
}
- put_long_date_timespec(p, c_timespec);
+ put_long_date_timespec(p, c_timespec); /* create time. */
p += 8;
put_long_date_timespec(p, a_timespec); /* access time */
p += 8;
@@ -1254,7 +1256,9 @@ static int call_nt_transact_create(connection_struct *conn, char *inbuf, char *o
}
oplock_request = (flags & REQUEST_OPLOCK) ? EXCLUSIVE_OPLOCK : 0;
- oplock_request |= (flags & REQUEST_BATCH_OPLOCK) ? BATCH_OPLOCK : 0;
+ if (oplock_request) {
+ oplock_request |= (flags & REQUEST_BATCH_OPLOCK) ? BATCH_OPLOCK : 0;
+ }
/*
* Ordinary file or directory.
@@ -1323,14 +1327,13 @@ static int call_nt_transact_create(connection_struct *conn, char *inbuf, char *o
return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
}
- oplock_request = 0;
-
/*
* We will get a create directory here if the Win32
* app specified a security descriptor in the
* CreateDirectory() call.
*/
+ oplock_request = 0;
status = open_directory(conn, fname, &sbuf,
access_mask,
share_access,