summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/close.c6
-rw-r--r--source3/smbd/fileio.c8
-rw-r--r--source3/smbd/open.c10
-rw-r--r--source3/smbd/reply.c2
-rw-r--r--source3/smbd/smb2_close.c2
-rw-r--r--source3/smbd/vfs.c4
6 files changed, 18 insertions, 14 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 0e75bf05c91..1cb546055d0 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -327,7 +327,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
if (e->name_hash != fsp->name_hash) {
continue;
}
- if (fsp->posix_open
+ if ((fsp->posix_flags & FSP_POSIX_FLAGS_OPEN)
&& (e->flags & SHARE_MODE_FLAG_POSIX_OPEN)) {
continue;
}
@@ -1103,7 +1103,9 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
struct share_mode_entry *e = &lck->data->share_modes[i];
if (is_valid_share_mode_entry(e) &&
e->name_hash == fsp->name_hash) {
- if (fsp->posix_open && (e->flags & SHARE_MODE_FLAG_POSIX_OPEN)) {
+ if ((fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) &&
+ (e->flags & SHARE_MODE_FLAG_POSIX_OPEN))
+ {
continue;
}
if (serverid_equal(&self, &e->pid) &&
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 6ba7285f73c..ebf91f4b8f4 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -193,7 +193,7 @@ void trigger_write_time_update(struct files_struct *fsp)
{
int delay;
- if (fsp->posix_open) {
+ if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
/* Don't use delayed writes on POSIX files. */
return;
}
@@ -238,7 +238,7 @@ void trigger_write_time_update_immediate(struct files_struct *fsp)
{
struct smb_file_time ft;
- if (fsp->posix_open) {
+ if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
/* Don't use delayed writes on POSIX files. */
return;
}
@@ -284,7 +284,7 @@ void mark_file_modified(files_struct *fsp)
}
trigger_write_time_update(fsp);
- if (fsp->posix_open) {
+ if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
return;
}
if (!(lp_store_dos_attributes(SNUM(fsp->conn)) ||
@@ -1020,7 +1020,7 @@ NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_throug
int fsp_stat(files_struct *fsp)
{
if (fsp->fh->fd == -1) {
- if (fsp->posix_open) {
+ if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
return SMB_VFS_LSTAT(fsp->conn, fsp->fsp_name);
} else {
return SMB_VFS_STAT(fsp->conn, fsp->fsp_name);
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index ebf7b9744ae..2e0881871e8 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -362,7 +362,7 @@ NTSTATUS fd_open(struct connection_struct *conn,
* client should be doing this.
*/
- if (fsp->posix_open || !lp_follow_symlinks(SNUM(conn))) {
+ if ((fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) || !lp_follow_symlinks(SNUM(conn))) {
flags |= O_NOFOLLOW;
}
#endif
@@ -945,7 +945,7 @@ static NTSTATUS open_file(files_struct *fsp,
access_mask);
if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND) &&
- fsp->posix_open &&
+ (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) &&
S_ISLNK(smb_fname->st.st_ex_mode)) {
/* This is a POSIX stat open for delete
* or rename on a symlink that points
@@ -2704,7 +2704,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
fsp->access_mask = open_access_mask; /* We change this to the
* requested access_mask after
* the open is done. */
- fsp->posix_open = posix_open;
+ fsp->posix_flags |= posix_open ? FSP_POSIX_FLAGS_OPEN : 0;
if (timeval_is_zero(&request_time)) {
request_time = fsp->open_time;
@@ -3570,7 +3570,9 @@ static NTSTATUS open_directory(connection_struct *conn,
fsp->oplock_type = NO_OPLOCK;
fsp->sent_oplock_break = NO_BREAK_SENT;
fsp->is_directory = True;
- fsp->posix_open = (file_attributes & FILE_FLAG_POSIX_SEMANTICS) ? True : False;
+ if (file_attributes & FILE_FLAG_POSIX_SEMANTICS) {
+ fsp->posix_flags |= FSP_POSIX_FLAGS_ALL;
+ }
status = fsp_set_smb_fname(fsp, smb_dname);
if (!NT_STATUS_IS_OK(status)) {
file_free(req, fsp);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 0f96b0daf75..54cea91d3fa 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2649,7 +2649,7 @@ static NTSTATUS can_rename(connection_struct *conn, files_struct *fsp,
}
if (S_ISDIR(fsp->fsp_name->st.st_ex_mode)) {
- if (fsp->posix_open) {
+ if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
return NT_STATUS_OK;
}
diff --git a/source3/smbd/smb2_close.c b/source3/smbd/smb2_close.c
index ed53e1be0a7..367c9fa125e 100644
--- a/source3/smbd/smb2_close.c
+++ b/source3/smbd/smb2_close.c
@@ -231,7 +231,7 @@ static NTSTATUS smbd_smb2_close(struct smbd_smb2_request *req,
return NT_STATUS_NO_MEMORY;
}
- posix_open = fsp->posix_open;
+ posix_open = (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN);
smb_fname = cp_smb_filename(talloc_tos(), fsp->fsp_name);
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 7138759bf09..59167935953 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -1386,7 +1386,7 @@ NTSTATUS vfs_stat_fsp(files_struct *fsp)
int ret;
if(fsp->fh->fd == -1) {
- if (fsp->posix_open) {
+ if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
ret = SMB_VFS_LSTAT(fsp->conn, fsp->fsp_name);
} else {
ret = SMB_VFS_STAT(fsp->conn, fsp->fsp_name);
@@ -2018,7 +2018,7 @@ NTSTATUS vfs_chown_fsp(files_struct *fsp, uid_t uid, gid_t gid)
path = fsp->fsp_name->base_name;
}
- if (fsp->posix_open || as_root) {
+ if ((fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) || as_root) {
ret = SMB_VFS_LCHOWN(fsp->conn,
path,
uid, gid);