From 73acba046c787c0b850b2916acfa42808df591a9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 11 Jan 2007 00:35:06 +0000 Subject: r20672: Start working on the wildcard cases - put back this exception case. Jeremy. --- source/smbd/filename.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source/smbd/filename.c') diff --git a/source/smbd/filename.c b/source/smbd/filename.c index d8689fffbd0..3f02f6090fa 100644 --- a/source/smbd/filename.c +++ b/source/smbd/filename.c @@ -260,6 +260,25 @@ NTSTATUS unix_convert(connection_struct *conn, if (ISDOT(start)) { if (end) { + if (allow_wcard_last_component) { + /* We're terminating here so we + * can be a little slower and get + * the error code right. Windows + * treats the last part of the pathname + * separately I think, so if the last + * component is a wildcard then we treat + * this ./ as "end of component" */ + + const char *p = strchr(end+1, '/'); + + if (!p && ms_has_wild(end+1)) { + /* Error code at the end of a pathname. */ + return NT_STATUS_OBJECT_NAME_INVALID; + } else { + /* Error code within a pathname. */ + return NT_STATUS_OBJECT_PATH_NOT_FOUND; + } + } /* Error code within a pathname. */ return NT_STATUS_OBJECT_PATH_NOT_FOUND; } else { -- cgit