git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fffd611
)
s3:vfs:shadow_copy2: fix the corner case if cwd=/ in make_relative_path
author
Michael Adam
<obnox@samba.org>
Tue, 11 Apr 2017 10:03:20 +0000
(12:03 +0200)
committer
Jeremy Allison
<jra@samba.org>
Tue, 11 Apr 2017 23:41:13 +0000
(
01:41
+0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_shadow_copy2.c
patch
|
blob
|
history
diff --git
a/source3/modules/vfs_shadow_copy2.c
b/source3/modules/vfs_shadow_copy2.c
index f3ec8b61ab5e87f77e0d320ff767eb17029e8f77..83be84e50a82976316d33b6ac8344daf7bd099ae 100644
(file)
--- a/
source3/modules/vfs_shadow_copy2.c
+++ b/
source3/modules/vfs_shadow_copy2.c
@@
-444,7
+444,11
@@
static bool make_relative_path(const char *cwd, char *abs_path)
if (memcmp(abs_path, cwd, cwd_len) != 0) {
return false;
}
- if (abs_path[cwd_len] != '/' && abs_path[cwd_len] != '\0') {
+ /* The cwd_len != 1 case is for $cwd == '/' */
+ if (cwd_len != 1 &&
+ abs_path[cwd_len] != '/' &&
+ abs_path[cwd_len] != '\0')
+ {
return false;
}
if (abs_path[cwd_len] == '/') {