X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=source3%2Fsmbd%2Ffilename.c;h=81532a06dac8c819e66f168886ac71dc04763d29;hb=b709d20665ab7ad8889c4111e81f32493fbd4bf4;hp=d8137989f66dc430a0e785d9dbda2db2640dd89b;hpb=9f09d9bef7877e553d6d7c56eb04cdade311c5e6;p=metze%2Fsamba%2Fwip.git diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index d8137989f66d..81532a06dac8 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -268,6 +268,14 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, return NT_STATUS_NO_MEMORY; } + name_has_wildcard = ms_has_wild(name); + + /* Wildcard not valid anywhere. */ + if (name_has_wildcard && !allow_wcard_last_component) { + result = NT_STATUS_OBJECT_NAME_INVALID; + goto fail; + } + /* * stat the name - if it exists then we are all done! */ @@ -374,12 +382,6 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, name_has_wildcard = ms_has_wild(start); - /* Wildcard not valid anywhere. */ - if (name_has_wildcard && !allow_wcard_last_component) { - result = NT_STATUS_OBJECT_NAME_INVALID; - goto fail; - } - /* Wildcards never valid within a pathname. */ if (name_has_wildcard && end) { result = NT_STATUS_OBJECT_NAME_INVALID;