uint16_t fsp_get_share_entry_flags(const struct files_struct *fsp)
{
uint16_t flags = 0;
- uint32_t private_options = fh_get_private_options(fsp->fh);
if (fsp->fsp_flags.posix_open) {
flags |= SHARE_ENTRY_FLAG_POSIX_OPEN;
}
- if (private_options & NTCREATEX_FLAG_STREAM_BASEOPEN) {
+ if (fsp->fsp_flags.ntcreatex_stream_baseopen) {
flags |= SHARE_ENTRY_FLAG_STREAM_BASEOPEN;
}
- if (private_options & NTCREATEX_FLAG_DENY_DOS) {
+ if (fsp->fsp_flags.ntcreatex_deny_dos) {
flags |= SHARE_ENTRY_FLAG_DENY_DOS;
}
- if (private_options & NTCREATEX_FLAG_DENY_FCB) {
+ if (fsp->fsp_flags.ntcreatex_deny_fcb) {
flags |= SHARE_ENTRY_FLAG_DENY_FCB;
}
return flags;
int fd;
uint64_t position_information;
off_t pos;
- /*
- * NT Create options, but we only look at
- * NTCREATEX_FLAG_DENY_DOS and
- * NTCREATEX_FLAG_DENY_FCB.
- */
- uint32_t private_options;
uint64_t gen_id;
};
fh->pos = pos;
}
-uint32_t fh_get_private_options(struct fd_handle *fh)
-{
- return fh->private_options;
-}
-
-void fh_set_private_options(struct fd_handle *fh, uint32_t private_options)
-{
- fh->private_options = private_options;
-}
-
uint64_t fh_get_gen_id(struct fd_handle *fh)
{
return fh->gen_id;
off_t fh_get_pos(struct fd_handle *fh);
void fh_set_pos(struct fd_handle *fh, off_t pos);
-uint32_t fh_get_private_options(struct fd_handle *fh);
-void fh_set_private_options(struct fd_handle *fh, uint32_t private_options);
-
uint64_t fh_get_gen_id(struct fd_handle *fh);
void fh_set_gen_id(struct fd_handle *fh, uint64_t gen_id);
*/
fsp->file_id = vfs_file_id_from_sbuf(conn, &smb_fname->st);
}
- fh_set_private_options(fsp->fh, private_flags);
+ fsp_apply_private_ntcreatex_flags(fsp, private_flags);
fsp->access_mask = open_access_mask; /* We change this to the
* requested access_mask after
* the open is done. */
fsp->fsp_flags.can_read = false;
fsp->fsp_flags.can_write = false;
- fh_set_private_options(fsp->fh, 0);
+ fsp_apply_private_ntcreatex_flags(fsp, 0);
/*
* According to Samba4, SEC_FILE_READ_ATTRIBUTE is always granted,
*/
DBG_DEBUG("Checking file %s, fd = %d, vuid = %"PRIu64", "
"file_pid = %"PRIu16", "
- "private_options = 0x%"PRIx32", "
+ "ntcreatex_deny_dos: %s, "
+ "ntcreatex_deny_fcb: %s, "
"access_mask = 0x%"PRIx32"\n",
fsp_str_dbg(fsp),
fsp_get_pathref_fd(fsp),
fsp->vuid,
fsp->file_pid,
- fh_get_private_options(fsp->fh),
+ fsp->fsp_flags.ntcreatex_deny_dos ? "yes":"no",
+ fsp->fsp_flags.ntcreatex_deny_fcb ? "yes":"no",
fsp->access_mask);
if (fsp_get_pathref_fd(fsp) != -1 &&
fsp->vuid == req->vuid &&
fsp->file_pid == req->smbpid &&
- (fh_get_private_options(fsp->fh) &
- (NTCREATEX_FLAG_DENY_DOS |
- NTCREATEX_FLAG_DENY_FCB)) &&
+ (fsp->fsp_flags.ntcreatex_deny_dos |
+ fsp->fsp_flags.ntcreatex_deny_fcb) &&
(fsp->access_mask & FILE_WRITE_DATA) &&
strequal(fsp->fsp_name->base_name, smb_fname->base_name) &&
strequal(fsp->fsp_name->stream_name,
/* quite an insane set of semantics ... */
if (is_executable(smb_fname->base_name) &&
- (fh_get_private_options(fsp->fh) & NTCREATEX_FLAG_DENY_DOS)) {
+ fsp->fsp_flags.ntcreatex_deny_dos) {
DBG_DEBUG("file fail due to is_executable.\n");
return NULL;
}