return NT_STATUS_OK;
}
+ if (access_mask == DELETE_ACCESS && S_ISLNK(smb_fname->st.st_ex_mode)) {
+ /* We can always delete a symlink. */
+ DEBUG(10,("smbd_check_access_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,
(SECINFO_OWNER |
SECINFO_GROUP |
if ((oplock_request & INTERNAL_OPEN_ONLY) || is_stat_open(fsp->access_mask)) {
return false;
}
-
- if (batch_entry != NULL) {
- /* Found a batch oplock */
- send_break_message(fsp, batch_entry, mid, oplock_request);
- return true;
+ if (batch_entry == NULL) {
+ return false;
}
- return false;
+
+ /* Found a batch oplock */
+ send_break_message(fsp, batch_entry, mid, oplock_request);
+ return true;
}
static bool delay_for_exclusive_oplocks(files_struct *fsp,
int oplock_request,
struct share_mode_entry *ex_entry)
{
+ bool delay_it;
+
if ((oplock_request & INTERNAL_OPEN_ONLY) || is_stat_open(fsp->access_mask)) {
return false;
}
+ if (ex_entry == NULL) {
+ return false;
+ }
- if (ex_entry != NULL) {
- /* Found an exclusive or batch oplock */
- bool delay_it = is_delete_request(fsp) ?
- BATCH_OPLOCK_TYPE(ex_entry->op_type) : true;
- if (delay_it) {
- send_break_message(fsp, ex_entry, mid, oplock_request);
- return true;
- }
+ /* Found an exclusive or batch oplock */
+
+ delay_it = is_delete_request(fsp) ?
+ BATCH_OPLOCK_TYPE(ex_entry->op_type) : true;
+
+ if (!delay_it) {
+ return false;
}
- return false;
+
+ send_break_message(fsp, ex_entry, mid, oplock_request);
+ return true;
}
static void grant_fsp_oplock_type(files_struct *fsp,
fsp->oplock_type = NO_OPLOCK;
}
- if (!(flags2 & O_TRUNC)) {
- info = FILE_WAS_OPENED;
- } else {
+ if (flags2 & O_TRUNC) {
info = FILE_WAS_OVERWRITTEN;
+ } else {
+ info = FILE_WAS_OPENED;
}
} else {
info = FILE_WAS_CREATED;
fsp->oplock_type = NO_OPLOCK;
}
- if (info == FILE_WAS_OVERWRITTEN || info == FILE_WAS_CREATED || info == FILE_WAS_SUPERSEDED) {
- new_file_created = True;
- }
-
set_share_mode(lck, fsp, get_current_uid(conn),
req ? req->mid : 0,
fsp->oplock_type);
fsp->initial_delete_on_close = True;
}
+ if (info == FILE_WAS_OVERWRITTEN
+ || info == FILE_WAS_CREATED
+ || info == FILE_WAS_SUPERSEDED) {
+ new_file_created = True;
+ }
+
if (new_file_created) {
/* Files should be initially set as archive */
if (lp_map_archive(SNUM(conn)) ||