*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
+#include "param/param.h"
/* This map was extracted by the ERRMAPEXTRACT smbtorture command.
The setup was a Samba HEAD (2002-01-03) PDC and an Win2k member
NTSTATUS ntstatus;
WERROR werror;
} ntstatus_to_werror_map[] = {
+ /*
+ * we add this manualy here, so that W_ERROR(0x5)
+ * gets mapped to NTSTATUS_ACCESS_DENIED
+ */
+ {NT_STATUS_ACCESS_DENIED, WERR_ACCESS_DENIED},
{NT_STATUS(0x103), W_ERROR(0x3e5)},
{NT_STATUS(0x105), W_ERROR(0xea)},
{NT_STATUS(0x106), W_ERROR(0x514)},
*ecode = 0;
return;
}
+ if (NT_STATUS_IS_DOS(ntstatus)) {
+ *eclass = NT_STATUS_DOS_CLASS(ntstatus);
+ *ecode = NT_STATUS_DOS_CODE(ntstatus);
+ return;
+ }
for (i=0; NT_STATUS_V(ntstatus_to_dos_map[i].ntstatus); i++) {
if (NT_STATUS_V(ntstatus) ==
NT_STATUS_V(ntstatus_to_dos_map[i].ntstatus)) {
const struct unix_error_map unix_nt_errmap[] = {
{ EAGAIN, STATUS_MORE_ENTRIES },
{ EINTR, STATUS_MORE_ENTRIES },
+ { ENOBUFS, STATUS_MORE_ENTRIES },
+#ifdef EWOULDBLOCK
+ { EWOULDBLOCK, STATUS_MORE_ENTRIES },
+#endif
{ EINPROGRESS, NT_STATUS_MORE_PROCESSING_REQUIRED },
{ EPERM, NT_STATUS_ACCESS_DENIED },
{ EACCES, NT_STATUS_ACCESS_DENIED },
{ ENOTSOCK, NT_STATUS_INVALID_HANDLE },
{ EFAULT, NT_STATUS_INVALID_PARAMETER },
{ EMSGSIZE, NT_STATUS_INVALID_BUFFER_SIZE },
- { ENOBUFS, NT_STATUS_NO_MEMORY },
{ ENOMEM, NT_STATUS_NO_MEMORY },
{ EPIPE, NT_STATUS_CONNECTION_DISCONNECTED },
{ ECONNREFUSED, NT_STATUS_CONNECTION_REFUSED },
#ifdef ENOTSUP
{ ENOTSUP, NT_STATUS_NOT_SUPPORTED},
#endif
+#ifdef EOPNOTSUPP
+ { EOPNOTSUPP, NT_STATUS_NOT_SUPPORTED},
+#endif
#ifdef EHOSTUNREACH
{ EHOSTUNREACH, NT_STATUS_HOST_UNREACHABLE },
#endif
#ifdef ENETUNREACH
- { ENETUNREACH, NT_STATUS_NETWORK_UNREACHABLE },
+ { ENETUNREACH, NT_STATUS_NETWORK_UNREACHABLE },
#endif
#ifdef ETIMEDOUT
- { ETIMEDOUT, NT_STATUS_IO_TIMEOUT },
+ { ETIMEDOUT, NT_STATUS_IO_TIMEOUT },
#endif
#ifdef EADDRINUSE
{ EADDRINUSE, NT_STATUS_ADDRESS_ALREADY_ASSOCIATED },
#endif
#ifdef ENODEV
{ ENODEV, NT_STATUS_NO_SUCH_DEVICE },
+#endif
+#ifdef ENOSYS
+ { ENOSYS, NT_STATUS_INVALID_SYSTEM_SERVICE },
#endif
{ 0, NT_STATUS_UNSUCCESSFUL }
};