From 16a6181289b719baeae7fae7fe0ba746fd5d41a6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 15 Oct 2012 18:16:44 +0200 Subject: [PATCH] s3-shadow-copy2: Fix dir/@GMT-2012.10.15-13.48.43 form of paths The previous clause in shadow_copy2_strip_snapshot would only handle @GMT- at the end of a pathname if it was the *only* pathname component. XP seems to send @GMT- at the end under certain circumstances even with a path prefix. Signed-off-by: Volker Lendecke Reviewed-by: Christof Schmitt --- source3/modules/vfs_shadow_copy2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 1b3c48416d2..82149f2cb7f 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -263,10 +263,10 @@ static bool shadow_copy2_strip_snapshot(TALLOC_CTX *mem_ctx, DEBUG(10, ("timestamp==-1\n")); goto no_snapshot; } - if ((p == name) && (q[0] == '\0')) { + if (q[0] == '\0') { /* the name consists of only the GMT token */ if (pstripped != NULL) { - stripped = talloc_strdup(mem_ctx, ""); + stripped = talloc_strndup(mem_ctx, name, p - name); if (stripped == NULL) { return false; } -- 2.11.4.GIT