From: Jeremy Allison Date: Tue, 7 Apr 2020 00:44:56 +0000 (-0700) Subject: s3: smbd: Reformatting - fix indentation in fd_open(). X-Git-Tag: ldb-2.2.0~927 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ec68cdfc46fc66e822f4a11ad7bf5c28d537f01;p=thirdparty%2Fsamba.git s3: smbd: Reformatting - fix indentation in fd_open(). Now we removed the lp_widelinks() clause we left an extra {..} level of indirection. Just reformat to remove it. No logic changes. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index acbe50229e9..b2d0455ba43 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -749,6 +749,9 @@ NTSTATUS fd_open(struct connection_struct *conn, { struct smb_filename *smb_fname = fsp->fsp_name; NTSTATUS status = NT_STATUS_OK; + struct smb_filename *conn_rootdir_fname = NULL; + const char *conn_rootdir; + int saved_errno = 0; /* * Never follow symlinks on a POSIX client. The @@ -760,42 +763,38 @@ NTSTATUS fd_open(struct connection_struct *conn, } /* Ensure path is below share definition. */ - { - struct smb_filename *conn_rootdir_fname = NULL; - const char *conn_rootdir = SMB_VFS_CONNECTPATH(conn, - smb_fname); - int saved_errno = 0; + conn_rootdir = SMB_VFS_CONNECTPATH(conn, + smb_fname); - if (conn_rootdir == NULL) { - return NT_STATUS_NO_MEMORY; - } - conn_rootdir_fname = synthetic_smb_fname(talloc_tos(), - conn_rootdir, - NULL, - NULL, - 0); - if (conn_rootdir_fname == NULL) { - return NT_STATUS_NO_MEMORY; - } - - /* - * Only follow symlinks within a share - * definition. - */ - fsp->fh->fd = non_widelink_open(conn, - conn_rootdir_fname, - fsp, - smb_fname, - flags, - mode, + if (conn_rootdir == NULL) { + return NT_STATUS_NO_MEMORY; + } + conn_rootdir_fname = synthetic_smb_fname(talloc_tos(), + conn_rootdir, + NULL, + NULL, 0); - if (fsp->fh->fd == -1) { - saved_errno = errno; - } - TALLOC_FREE(conn_rootdir_fname); - if (saved_errno != 0) { - errno = saved_errno; - } + if (conn_rootdir_fname == NULL) { + return NT_STATUS_NO_MEMORY; + } + + /* + * Only follow symlinks within a share + * definition. + */ + fsp->fh->fd = non_widelink_open(conn, + conn_rootdir_fname, + fsp, + smb_fname, + flags, + mode, + 0); + if (fsp->fh->fd == -1) { + saved_errno = errno; + } + TALLOC_FREE(conn_rootdir_fname); + if (saved_errno != 0) { + errno = saved_errno; } if (fsp->fh->fd == -1) {