From 7f17f286d3a4a0b864fa771f945a8fc02e45ae4d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 7 Oct 2009 15:49:56 -0700 Subject: [PATCH] Correct fix for bug 6781 - Cannot rename subfolders in Explorer view with recent versions of Samba. Without this fix, renaming a directory ./a to ./b, whilst a directory ./aa was already open would fail. Jeremy. (cherry picked from commit 1f604d26d038956a6ddde892610c9b2254268160) --- source/smbd/files.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/smbd/files.c b/source/smbd/files.c index cdaa5f11db5..e74ad7afe48 100644 --- a/source/smbd/files.c +++ b/source/smbd/files.c @@ -407,13 +407,18 @@ bool file_find_subpath(files_struct *dir_fsp) fsp->conn->connectpath, fsp->fsp_name); - if (strnequal(d_fullname, d1_fullname, dlen)) { + /* + * If the open file has a path that is a longer + * component, then it's a subpath. + */ + if (strnequal(d_fullname, d1_fullname, dlen) && + (d1_fullname[dlen] == '/')) { TALLOC_FREE(d_fullname); TALLOC_FREE(d1_fullname); return true; } TALLOC_FREE(d1_fullname); - } + } TALLOC_FREE(d_fullname); return false; -- 2.11.4.GIT