From: Volker Lendecke Date: Wed, 28 Oct 2020 14:40:39 +0000 (+0100) Subject: smbd: Use ISDOT[DOT] in can_delete_directory_fsp() X-Git-Tag: samba-4.14.0rc1~679 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be381fd45471098099309067dab68cebc9ce5b53;p=thirdparty%2Fsamba.git smbd: Use ISDOT[DOT] in can_delete_directory_fsp() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 6b5b4715d54..14ce758422b 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1776,12 +1776,9 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp) } while ((dname = ReadDirName(dir_hnd, &dirpos, &st, &talloced))) { - /* Quick check for "." and ".." */ - if (dname[0] == '.') { - if (!dname[1] || (dname[1] == '.' && !dname[2])) { - TALLOC_FREE(talloced); - continue; - } + if (ISDOT(dname) || (ISDOTDOT(dname))) { + TALLOC_FREE(talloced); + continue; } if (!is_visible_file(conn,