Always map EMFILE to ERRDOS, ERRnofids, *NOT* NT_STATUS_TOO_MANY_OPENED_FILES.
authorJeremy Allison <jra@samba.org>
Fri, 18 Dec 2009 02:31:44 +0000 (18:31 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 18 Dec 2009 02:31:44 +0000 (18:31 -0800)
This is what W2KR3 does for NTCreateX and openX calls. May be the correct fix
for bug 6837 - "Too many open files" when trying to access large number of files.
Jeremy.

source3/smbd/error.c

index 874efa2a0b37fc3a5fd30b9f11afa53748c7c5e9..279b7baff0c72d4d9590dacf9922195a332c8b08 100644 (file)
@@ -132,6 +132,10 @@ void reply_openerror(struct smb_request *req, NTSTATUS status)
                 */
                reply_botherror(req, NT_STATUS_OBJECT_NAME_COLLISION,
                        ERRDOS, ERRfilexists);
+       } else if (NT_STATUS_EQUAL(status, NT_STATUS_TOO_MANY_OPENED_FILES)) {
+               /* EMFILE always seems to be returned as a DOS error.
+                * See bug 6837. */
+               reply_doserror(req, ERRDOS, ERRnofids);
        } else {
                reply_nterror(req, status);
        }