return NT_STATUS_OK;
}
+ if (access_mask == DELETE_ACCESS &&
+ VALID_STAT(smb_fname->st) &&
+ S_ISLNK(smb_fname->st.st_ex_mode)) {
+ /* We can always delete a symlink. */
+ DEBUG(10,("smbd_check_open_rights: not checking ACL "
+ "on DELETE_ACCESS on symlink %s.\n",
+ smb_fname_str_dbg(smb_fname) ));
+ return NT_STATUS_OK;
+ }
+
status = SMB_VFS_GET_NT_ACL(conn, smb_fname->base_name,
(OWNER_SECURITY_INFORMATION |
GROUP_SECURITY_INFORMATION |
return NT_STATUS_OK;
}
-static bool is_delete_request(files_struct *fsp) {
- return ((fsp->access_mask == DELETE_ACCESS) &&
- (fsp->oplock_type == NO_OPLOCK));
-}
-
/*
* Send a break message to the oplock holder and delay the open for
* our client.
}
if (exclusive != NULL) { /* Found an exclusive oplock */
- bool delay_it = is_delete_request(fsp) ?
- BATCH_OPLOCK_TYPE(exclusive->op_type) : true;
SMB_ASSERT(!have_level2);
- if (delay_it) {
- send_break_message(fsp, exclusive, mid, oplock_request);
- return true;
- }
+ send_break_message(fsp, exclusive, mid, oplock_request);
+ return true;
}
/*
ZERO_STRUCT(id);
- /* Windows allows a new file to be created and
- silently removes a FILE_ATTRIBUTE_DIRECTORY
- sent by the client. Do the same. */
-
- new_dos_attributes &= ~FILE_ATTRIBUTE_DIRECTORY;
-
if (conn->printer) {
/*
* Printers are handled completely differently.
unx_mode = (mode_t)(new_dos_attributes & ~FILE_FLAG_POSIX_SEMANTICS);
new_dos_attributes = 0;
} else {
+ /* Windows allows a new file to be created and
+ silently removes a FILE_ATTRIBUTE_DIRECTORY
+ sent by the client. Do the same. */
+
+ new_dos_attributes &= ~FILE_ATTRIBUTE_DIRECTORY;
+
/* We add aARCH to this as this mode is only used if the file is
* created new. */
unx_mode = unix_mode(conn, new_dos_attributes | aARCH,
remove_deferred_open_smb_message(req->mid);
}
- 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) {
SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname));
- /* Ensure we have a directory attribute. */
- file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
+ if (!(file_attributes & FILE_FLAG_POSIX_SEMANTICS)) {
+ /* Ensure we have a directory attribute. */
+ file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
+ }
DEBUG(5,("open_directory: opening directory %s, access_mask = 0x%x, "
"share_access = 0x%x create_options = 0x%x, "
}
}
- /* All file access must go through check_name() */
-
- status = check_name(conn, smb_fname->base_name);
- if (!NT_STATUS_IS_OK(status)) {
- goto fail;
- }
-
status = create_file_unixpath(
conn, req, smb_fname, access_mask, share_access,
create_disposition, create_options, file_attributes,