From: Volker Lendecke Date: Tue, 20 Dec 2022 13:40:26 +0000 (+0100) Subject: smbd: Simplify filename_convert_dirfsp_nosymlink() X-Git-Tag: talloc-2.4.0~153 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70b515be9c8fa5ff44cc2c2c1c9829f1591a371b;p=thirdparty%2Fsamba.git smbd: Simplify filename_convert_dirfsp_nosymlink() Avoid a nested if, the "&&" is easier to understand for me. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index a7cf7a14d92..be24854f89c 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -1268,19 +1268,11 @@ static NTSTATUS filename_convert_dirfsp_nosymlink( #endif } - if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { + if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND) && + !VALID_STAT(smb_fname_rel->st)) { char *normalized = NULL; - if (VALID_STAT(smb_fname_rel->st)) { - /* - * NT_STATUS_OBJECT_NAME_NOT_FOUND is - * misleading: The object exists but might be - * a symlink pointing outside the share. - */ - goto fail; - } - /* * Creating a new file */