r20722: RAW-CHKPATH should now pass, build farm should
authorJeremy Allison <jra@samba.org>
Sat, 13 Jan 2007 02:13:45 +0000 (02:13 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:17:06 +0000 (12:17 -0500)
go back to normal. Sorry about that.
Jeremy.
(This used to be commit d4127034fb89185fe7464d57c9f56f7914da6141)

source3/smbd/filename.c

index dd1e0de20f2ee87afc1e1c25fe7bdfb23bd6e96a..a36b7ff28211a4cdccfb9ae0897284b918b5a8eb 100644 (file)
@@ -391,15 +391,24 @@ NTSTATUS unix_convert(connection_struct *conn,
                                         * Windows applications depend on the difference between
                                         * these two errors.
                                         */
-                                       if (errno == ENOENT) {
+
+                                       /* ENOENT and ENOTDIR both map to NT_STATUS_OBJECT_PATH_NOT_FOUND
+                                          in the filename walk. */
+
+                                       if (errno == ENOENT || errno == ENOTDIR) {
                                                return NT_STATUS_OBJECT_PATH_NOT_FOUND;
                                        }
                                        return map_nt_error_from_unix(errno);
                                }
              
-                               if (errno == ENOTDIR) {
-                                       /* Name exists but is not a directory. */
-                                       return map_nt_error_from_unix(ENOTDIR);
+                               /* ENOENT is the only valid error here. */
+                               if (errno != ENOENT) {
+                                       /* ENOENT and ENOTDIR both map to NT_STATUS_OBJECT_PATH_NOT_FOUND
+                                          in the filename walk. */
+                                       if (errno == ENOTDIR) {
+                                               return NT_STATUS_OBJECT_PATH_NOT_FOUND;
+                                       }
+                                       return map_nt_error_from_unix(errno);
                                }
 
                                /*