summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-05-29 17:14:49 +0200
committerAndrew Bartlett <abartlet@samba.org>2013-10-05 09:21:24 +1300
commit3d053b1ab3e0b918509e06086a54834a9ae9cdb7 (patch)
treec1b7d41694c7c2e4f5b9b562d6454a2c58c149cc /source3/modules
parent38e108563d7e9e14203bf4dabfda09bd1408e980 (diff)
downloadsamba-3d053b1ab3e0b918509e06086a54834a9ae9cdb7.tar.gz
samba-3d053b1ab3e0b918509e06086a54834a9ae9cdb7.tar.bz2
samba-3d053b1ab3e0b918509e06086a54834a9ae9cdb7.zip
shadow_copy2: add comments explaining decisions in shadow_copy2_strip_snapshot()
This should make it more easy to understand what the cases are. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_shadow_copy2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index ec608849cc..ade8c28a12 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -316,6 +316,7 @@ static bool shadow_copy2_strip_snapshot(TALLOC_CTX *mem_ctx,
goto no_snapshot;
}
if ((p > name) && (p[-1] != '/')) {
+ /* the GMT-token does not start a path-component */
goto no_snapshot;
}
q = strptime(p, GMT_FORMAT, &tm);
@@ -328,6 +329,7 @@ static bool shadow_copy2_strip_snapshot(TALLOC_CTX *mem_ctx,
goto no_snapshot;
}
if ((p == name) && (q[0] == '\0')) {
+ /* the name consists of only the GMT token */
if (pstripped != NULL) {
stripped = talloc_strdup(mem_ctx, "");
if (stripped == NULL) {
@@ -339,6 +341,14 @@ static bool shadow_copy2_strip_snapshot(TALLOC_CTX *mem_ctx,
return true;
}
if (q[0] != '/') {
+ /*
+ * The GMT token is either at the end of the path
+ * or it is not a complete path component, i.e. the
+ * path component continues after the gmt-token.
+ *
+ * TODO: Is this correct? Or would the GMT tag as the
+ * last component be a valid input?
+ */
goto no_snapshot;
}
q += 1;