[PATCH] smbd: Fix snapshot query on shares with DFS enabled
Jeremy Allison
jra at samba.org
Fri Aug 12 23:51:35 UTC 2016
On Fri, Aug 12, 2016 at 03:59:27PM -0700, Christof Schmitt wrote:
> From 3a33435fc3d61605c75ed3f3b87612fbe729b553 Mon Sep 17 00:00:00 2001
> From: Christof Schmitt <cs at samba.org>
> Date: Fri, 12 Aug 2016 14:59:07 -0700
> Subject: [PATCH] smbd: Fix snapshot query on shares with DFS enabled
>
> When DFS is enabled (host msdfs = yes and msdfs root = yes), then SMB
> clients send create requests in the format \hostname\service\path.
> Putting the GMT tag as first element breaks the DFS parsing and results
> in OBJECT_NOT_FOUND for snapshotted files. Fix this by appending the
> GMT tag to the end of the path.
Great catch ! Pushed with additional comment:
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12150
as we're going to need this backported.
> Signed-off-by: Christof Schmitt <cs at samba.org>
> ---
> source3/smbd/smb2_create.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
> index 4c1b81d..75da8a1 100644
> --- a/source3/smbd/smb2_create.c
> +++ b/source3/smbd/smb2_create.c
> @@ -913,14 +913,14 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
>
> TALLOC_FREE(fname);
> fname = talloc_asprintf(state,
> - "@GMT-%04u.%02u.%02u-%02u.%02u.%02u\\%s",
> + "%s\\@GMT-%04u.%02u.%02u-%02u.%02u.%02u",
> + in_name,
> tm->tm_year + 1900,
> tm->tm_mon + 1,
> tm->tm_mday,
> tm->tm_hour,
> tm->tm_min,
> - tm->tm_sec,
> - in_name);
> + tm->tm_sec);
> if (tevent_req_nomem(fname, req)) {
> return tevent_req_post(req, ev);
> }
> --
> 1.8.3.1
>
More information about the samba-technical
mailing list