summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-10-15 18:16:44 +0200
committerVolker Lendecke <vl@samba.org>2014-06-27 06:49:10 +0200
commit16a6181289b719baeae7fae7fe0ba746fd5d41a6 (patch)
treeb01558214a14ad77294601726fc46f9e819fe635
parent68c7b339ccb02305a27b1192222537074efa0085 (diff)
downloadsamba-16a6181289b719baeae7fae7fe0ba746fd5d41a6.tar.gz
samba-16a6181289b719baeae7fae7fe0ba746fd5d41a6.tar.xz
samba-16a6181289b719baeae7fae7fe0ba746fd5d41a6.zip
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 <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
-rw-r--r--source3/modules/vfs_shadow_copy2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 1b3c48416d..82149f2cb7 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;
}