summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-01-13 01:07:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:05 -0500
commit1a40a6e08a58d02e912aaa9f81dcff48477f3b81 (patch)
treedc405ad013efaad19381d70c4acefb0dcb05d386 /source3
parentdb0ad252a0622dfac17d44ca646168df4c1c22e5 (diff)
downloadsamba-1a40a6e08a58d02e912aaa9f81dcff48477f3b81.tar.gz
samba-1a40a6e08a58d02e912aaa9f81dcff48477f3b81.tar.bz2
samba-1a40a6e08a58d02e912aaa9f81dcff48477f3b81.zip
r20720: Fix the chkpath problem, still looking at findfirst.
Jeremy. (This used to be commit c5be0082ef60cd041121a9c36f4af934cd60562d)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/filename.c7
-rw-r--r--source3/smbd/reply.c7
2 files changed, 13 insertions, 1 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 3f02f6090f..44916200da 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -147,7 +147,12 @@ NTSTATUS unix_convert(connection_struct *conn,
if (name[0] == '.' && (name[1] == '/' || name[1] == '\0')) {
/* Start of pathname can't be "." only. */
- return NT_STATUS_OBJECT_NAME_INVALID;
+ if (name[1] == '\0' || name[2] == '\0') {
+ return NT_STATUS_OBJECT_NAME_INVALID;
+ } else {
+ /* Longer pathname starts with ./ */
+ return NT_STATUS_OBJECT_PATH_NOT_FOUND;
+ }
}
/*
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 5914a3b169..e42c663cec 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -632,6 +632,13 @@ int reply_chkpth(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
status = unix_convert(conn, name, False, NULL, &sbuf);
if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBchkpth);
+ /* Strange DOS error code semantics only for chkpth... */
+ if (!(SVAL(inbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES)) {
+ if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_INVALID,status)) {
+ /* We need to map to ERRbadpath */
+ status = NT_STATUS_OBJECT_PATH_NOT_FOUND;
+ }
+ }
return ERROR_NT(status);
}