X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=source3%2Fsmbd%2Ffilename.c;fp=source3%2Fsmbd%2Ffilename.c;h=a69f51a9a94c1a71023d885ae2bc63aae87f1362;hb=bf86a59cfdbbd73e8935b955a194b337391691b0;hp=81532a06dac8c819e66f168886ac71dc04763d29;hpb=b709d20665ab7ad8889c4111e81f32493fbd4bf4;p=metze%2Fsamba%2Fwip.git diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 81532a06dac8..a69f51a9a94c 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -276,35 +276,37 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, goto fail; } - /* - * stat the name - if it exists then we are all done! - */ + if (!name_has_wildcard) { + /* + * stat the name - if it exists then we are all done! + */ - if (posix_pathnames) { - ret = SMB_VFS_LSTAT(conn,name,&st); - } else { - ret = SMB_VFS_STAT(conn,name,&st); - } + if (posix_pathnames) { + ret = SMB_VFS_LSTAT(conn,name,&st); + } else { + ret = SMB_VFS_STAT(conn,name,&st); + } - if (ret == 0) { - /* Ensure we catch all names with in "/." - this is disallowed under Windows. */ - const char *p = strstr(name, "/."); /* mb safe. */ - if (p) { - if (p[2] == '/') { - /* Error code within a pathname. */ - result = NT_STATUS_OBJECT_PATH_NOT_FOUND; - goto fail; - } else if (p[2] == '\0') { - /* Error code at the end of a pathname. */ - result = NT_STATUS_OBJECT_NAME_INVALID; - goto fail; + if (ret == 0) { + /* Ensure we catch all names with in "/." + this is disallowed under Windows. */ + const char *p = strstr(name, "/."); /* mb safe. */ + if (p) { + if (p[2] == '/') { + /* Error code within a pathname. */ + result = NT_STATUS_OBJECT_PATH_NOT_FOUND; + goto fail; + } else if (p[2] == '\0') { + /* Error code at the end of a pathname. */ + result = NT_STATUS_OBJECT_NAME_INVALID; + goto fail; + } } + stat_cache_add(orig_path, name, conn->case_sensitive); + DEBUG(5,("conversion finished %s -> %s\n",orig_path, name)); + *pst = st; + goto done; } - stat_cache_add(orig_path, name, conn->case_sensitive); - DEBUG(5,("conversion finished %s -> %s\n",orig_path, name)); - *pst = st; - goto done; } DEBUG(5,("unix_convert begin: name = %s, dirpath = %s, start = %s\n",