From: Ralph Boehme Date: Tue, 17 Mar 2020 16:35:44 +0000 (+0100) Subject: smbd: simplify non_widelink_open() X-Git-Tag: ldb-2.2.0~1236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d961608ce9fbb2ec6ce6ad0979c08bb9911bbbee;p=thirdparty%2Fsamba.git smbd: simplify non_widelink_open() As fsp->is_directory is already correctly populated by our callers, we can drop the complicated and possibly broken logic that relies on O_DIRECTORY being defined. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 6e65ff8d53d..378c43272ab 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -612,16 +612,9 @@ static int non_widelink_open(struct connection_struct *conn, char *parent_dir = NULL; struct smb_filename parent_dir_fname = {0}; const char *final_component = NULL; - bool is_directory = false; bool ok; -#ifdef O_DIRECTORY - if (flags & O_DIRECTORY) { - is_directory = true; - } -#endif - - if (is_directory) { + if (fsp->is_directory) { parent_dir = talloc_strdup(talloc_tos(), smb_fname->base_name); if (parent_dir == NULL) { saved_errno = errno;