diff options
author | Jeremy Allison <jra@samba.org> | 2007-01-11 00:35:06 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-01-11 00:35:06 +0000 |
commit | 73acba046c787c0b850b2916acfa42808df591a9 (patch) | |
tree | 2eabe151779a87591f5bef2bde8567e63e7ce59f /source/smbd/filename.c | |
parent | 69dc001970c33226579484f3dfa40f0bff8c0b94 (diff) | |
download | samba-73acba046c787c0b850b2916acfa42808df591a9.tar.gz samba-73acba046c787c0b850b2916acfa42808df591a9.tar.xz samba-73acba046c787c0b850b2916acfa42808df591a9.zip |
r20672: Start working on the wildcard cases - put back this
exception case.
Jeremy.
Diffstat (limited to 'source/smbd/filename.c')
-rw-r--r-- | source/smbd/filename.c | 19 |
1 files changed, 19 insertions, 0 deletions
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 { |