summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-08-13 02:31:22 +0000
committerJeremy Allison <jra@samba.org>2003-08-13 02:31:22 +0000
commitdb58f5141612ed8a3d3ae03cda03cb44cd22d6de (patch)
tree219452ec159101762700b2f3ef4e44ae937f8265 /source3
parent0d28f130ff423e1e7a300dc92bc88e4b88e8a0e1 (diff)
downloadsamba-db58f5141612ed8a3d3ae03cda03cb44cd22d6de.tar.gz
samba-db58f5141612ed8a3d3ae03cda03cb44cd22d6de.tar.bz2
samba-db58f5141612ed8a3d3ae03cda03cb44cd22d6de.zip
More chkpth fixes from Samba4 tests.
Jeremy. (This used to be commit a62cf6bf16e2f435f504e936c31992f5697a309a)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/reply.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index dcb07ab509..4f3c12e984 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -401,8 +401,21 @@ int reply_chkpth(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
one at a time - if a component fails it expects
ERRbadpath, not ERRbadfile.
*/
- if(errno == ENOENT)
- return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
+ if(errno == ENOENT) {
+ /*
+ * Windows returns different error codes if
+ * the parent directory is valid but not the
+ * last component - it returns NT_STATUS_OBJECT_NAME_NOT_FOUND
+ * for that case and NT_STATUS_OBJECT_PATH_NOT_FOUND
+ * if the path is invalid.
+ */
+ if (bad_path) {
+ return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
+ } else {
+ return ERROR_NT(NT_STATUS_OBJECT_NAME_NOT_FOUND);
+ }
+ } else if (errno == ENOTDIR)
+ return ERROR_NT(NT_STATUS_NOT_A_DIRECTORY);
return(UNIXERROR(ERRDOS,ERRbadpath));
}