summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-02-29 09:08:57 +0100
committerStefan Metzmacher <metze@samba.org>2008-02-29 15:17:52 +0100
commit5734a10c89b3ca90ee9463320a9be268fed38e8f (patch)
tree279495fd6b2033a708b736991e41be8beb84a756 /source4/ntvfs
parentc5d961586e72b181b24fcbaf98c8da2fa27aa2d1 (diff)
downloadsamba-5734a10c89b3ca90ee9463320a9be268fed38e8f.tar.gz
samba-5734a10c89b3ca90ee9463320a9be268fed38e8f.tar.bz2
samba-5734a10c89b3ca90ee9463320a9be268fed38e8f.zip
pvfs_resolve: "\\" and a trailing "\" need to be reduced
metze (This used to be commit 356338b99a67bfaf09618f5ed7c8f5c4ff69fa06)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/posix/pvfs_resolve.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c
index c129038572..37b182733c 100644
--- a/source4/ntvfs/posix/pvfs_resolve.c
+++ b/source4/ntvfs/posix/pvfs_resolve.c
@@ -265,8 +265,15 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name,
of a name */
return NT_STATUS_ILLEGAL_CHARACTER;
}
- if (p > p_start && p[1] == 0) {
- *p = 0;
+ if (p > p_start && (p[1] == '\\' || p[1] == '\0')) {
+ /* see if it is definately a "\\" or
+ * a trailing "\". If it is then fail here,
+ * and let the next layer up try again after
+ * pvfs_reduce_name() if it wants to. This is
+ * much more efficient on average than always
+ * scanning for these separately
+ */
+ return NT_STATUS_OBJECT_PATH_SYNTAX_BAD;
} else {
*p = '/';
}