]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r21748: More cosmetic alignment. One change to call_nt_transact_create(): We were
authorVolker Lendecke <vlendec@samba.org>
Wed, 7 Mar 2007 14:25:07 +0000 (14:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:18:27 +0000 (12:18 -0500)
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

source/smbd/nttrans.c

index de3863eabe5cfd5ebfa7e07417f79468272b74eb..19989d2178209a8381ef9411e73f234b2a8193fe 100644 (file)
@@ -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,