From 5734a10c89b3ca90ee9463320a9be268fed38e8f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 29 Feb 2008 09:08:57 +0100 Subject: pvfs_resolve: "\\" and a trailing "\" need to be reduced metze (This used to be commit 356338b99a67bfaf09618f5ed7c8f5c4ff69fa06) --- source4/ntvfs/posix/pvfs_resolve.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs') 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 = '/'; } -- cgit