First part of fix for bug #8663 - deleting a symlink fails if the symlink target...
[mat/samba.git] / source3 / smbd / open.c
index 461206893be6a8601a019ad875605e2c41948b2e..5abc64dc99d5027347c47dea3dec8434d094df4b 100644 (file)
@@ -1275,11 +1275,9 @@ static void defer_open(struct share_mode_lock *lck,
        for (i=0; i<lck->num_share_modes; i++) {
                struct share_mode_entry *e = &lck->share_modes[i];
 
-               if (!is_deferred_open_entry(e)) {
-                       continue;
-               }
-
-               if (procid_is_me(&e->pid) && (e->op_mid == req->mid)) {
+               if (is_deferred_open_entry(e) &&
+                   procid_is_me(&e->pid) &&
+                   (e->op_mid == req->mid)) {
                        DEBUG(0, ("Trying to defer an already deferred "
                                "request: mid=%llu, exiting\n",
                                (unsigned long long)req->mid));
@@ -1725,11 +1723,6 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                }
        }
 
-       status = check_name(conn, smb_fname->base_name);
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
-
        if (!posix_open) {
                new_dos_attributes &= SAMBA_ATTRIBUTES_MASK;
                if (file_existed) {
@@ -3848,13 +3841,6 @@ NTSTATUS create_file_default(connection_struct *conn,
                }
        }
 
-       /* All file access must go through check_name() */
-
-       status = check_name(conn, smb_fname->base_name);
-       if (!NT_STATUS_IS_OK(status)) {
-               goto fail;
-       }
-
        if (stream_name && is_ntfs_default_stream_smb_fname(smb_fname)) {
                int ret;
                smb_fname->stream_name = NULL;