s3: VFS: shadow_copy2: Fix module to work with variable current working directory.
authorJeremy Allison <jra@samba.org>
Thu, 26 Jan 2017 18:49:51 +0000 (10:49 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 13 Feb 2017 15:49:17 +0000 (16:49 +0100)
commitd417f2a68af38ba9c23259610e75c9bfef05d530
tree26d40c8b223942b79daafb465e90af8529ac983f
parentdebe3a3742658239694354d0cf296a2175fcaa64
s3: VFS: shadow_copy2: Fix module to work with variable current working directory.

Completely cleans up the horrible shadow_copy2_strip_snapshot()
and adds an explaination of what it's actually trying to do.

* This function does two things.
*
* 1). Checks if an incoming filename is already a
* snapshot converted pathname.
*     If so, it returns the pathname truncated
*     at the snapshot point which will be used
*     as the connectpath, and then does an early return.
*
* 2). Checks if an incoming filename contains an
* SMB-layer @GMT- style timestamp.
*     If so, it strips the timestamp, and returns
*     both the timestamp and the stripped path
*     (making it cwd-relative).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12531

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 128d5f27cd42b0c7efcbe3d28fe3eee881e0734b)
source3/modules/vfs_shadow_copy2.c