From: Ralph Boehme Date: Thu, 9 Apr 2020 16:24:26 +0000 (+0200) Subject: smbd: add open_flags arg to in open_internal_dirfsp_at() X-Git-Tag: ldb-2.2.0~447 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=acffa8f406ed26752fcb45849c06f9c33a1ea570;p=thirdparty%2Fsamba.git smbd: add open_flags arg to in open_internal_dirfsp_at() The only caller passes in what was used internally, so no change in behaviour. Prepares for calling open_internal_dirfsp_at() from filename_convert() with additional flags. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index c5008657470..8d9a1fc4bcf 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1369,7 +1369,11 @@ struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx, struct smb_Dir *dir_hnd = NULL; NTSTATUS status; - status = open_internal_dirfsp_at(conn, conn->cwd_fsp, smb_dname, &fsp); + status = open_internal_dirfsp_at(conn, + conn->cwd_fsp, + smb_dname, + O_RDONLY, + &fsp); if (!NT_STATUS_IS_OK(status)) { return NULL; } diff --git a/source3/smbd/files.c b/source3/smbd/files.c index a700b3edd27..8968712fb3f 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -225,10 +225,10 @@ NTSTATUS create_internal_dirfsp_at(connection_struct *conn, NTSTATUS open_internal_dirfsp_at(connection_struct *conn, struct files_struct *dirfsp, const struct smb_filename *smb_dname, + int open_flags, struct files_struct **_fsp) { struct files_struct *fsp = NULL; - int open_flags = O_RDONLY; NTSTATUS status; SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 2476d08c8a2..9fdd85a3725 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -455,6 +455,7 @@ NTSTATUS create_internal_dirfsp_at(connection_struct *conn, NTSTATUS open_internal_dirfsp_at(connection_struct *conn, struct files_struct *dirfsp, const struct smb_filename *smb_dname, + int open_flags, struct files_struct **_fsp); /* The following definitions come from smbd/ipc.c */