[SCM] Samba Shared Repository - branch master updated - 60164e9002c28911dbfd7115cb9bff05be5aff25

Jelmer Vernooij jelmer at samba.org
Thu Oct 23 02:58:54 GMT 2008


The branch, master has been updated
       via  60164e9002c28911dbfd7115cb9bff05be5aff25 (commit)
       via  391ce30d497503ce998d0c5dbab9ea7d4fe3ed3b (commit)
       via  94c522b1ab2e969f8697f386ba6a933d0984a1dc (commit)
       via  e56dff3f7b0d7535ea208081dbbc4e67dcc1709a (commit)
       via  90bfd9d9e12840be0fc2ebe431ec44ee92e8b585 (commit)
       via  3be0f6ea56ed8e43cd287ed020e942efb675b87b (commit)
       via  52923c4ff4406110b82117243552beb0b5d9e1c0 (commit)
       via  ad50d78496537c3a902231c58e51f5c0a12ca536 (commit)
      from  596089ec06b0a2b2ec3e0e5bd6d46c2e767bd954 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 60164e9002c28911dbfd7115cb9bff05be5aff25
Merge: 391ce30d497503ce998d0c5dbab9ea7d4fe3ed3b 596089ec06b0a2b2ec3e0e5bd6d46c2e767bd954
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Oct 23 04:58:08 2008 +0200

    Merge branch 'master' of ssh://git.samba.org/data/git/samba

commit 391ce30d497503ce998d0c5dbab9ea7d4fe3ed3b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Oct 23 04:57:44 2008 +0200

    Fix header file installation.

commit 94c522b1ab2e969f8697f386ba6a933d0984a1dc
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Oct 23 03:29:20 2008 +0200

    Import NTSTATUS defines from Samba 3.

commit e56dff3f7b0d7535ea208081dbbc4e67dcc1709a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Oct 23 03:25:00 2008 +0200

    Import WERROR defines from Samba 3.

commit 90bfd9d9e12840be0fc2ebe431ec44ee92e8b585
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Oct 23 03:13:08 2008 +0200

    Import new DOS error codes from Samba 3.

commit 3be0f6ea56ed8e43cd287ed020e942efb675b87b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Oct 23 03:11:19 2008 +0200

    Move libcli-util error code to top-level.

commit 52923c4ff4406110b82117243552beb0b5d9e1c0
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Oct 23 03:07:27 2008 +0200

    Remove unused copy of tables.pl

commit ad50d78496537c3a902231c58e51f5c0a12ca536
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Oct 23 03:04:48 2008 +0200

    Remove unused copy of ndrdump.c.

-----------------------------------------------------------------------

Summary of changes:
 lib/util/asn1_proto.h          |    8 +-
 libcli/util/doserr.c           |  163 +++++
 libcli/util/doserr.h           |  176 +++++
 libcli/util/error.h            |   56 ++
 libcli/util/errormap.c         | 1403 ++++++++++++++++++++++++++++++++++++++++
 libcli/util/nterr.c            |  897 +++++++++++++++++++++++++
 libcli/util/ntstatus.h         |  682 +++++++++++++++++++
 libcli/util/werror.h           |  263 ++++++++
 source3/librpc/tables.pl       |   89 ---
 source3/librpc/tools/ndrdump.c |  445 -------------
 source4/headermap.txt          |    8 +-
 source4/libcli/config.mk       |    4 +-
 source4/libcli/util/doserr.c   |  163 -----
 source4/libcli/util/doserr.h   |  172 -----
 source4/libcli/util/error.h    |   56 --
 source4/libcli/util/errormap.c | 1403 ----------------------------------------
 source4/libcli/util/nterr.c    |  897 -------------------------
 source4/libcli/util/ntstatus.h |  678 -------------------
 source4/libcli/util/werror.h   |  215 ------
 source4/torture/rpc/epmapper.c |    2 -
 20 files changed, 3650 insertions(+), 4130 deletions(-)
 create mode 100644 libcli/util/doserr.c
 create mode 100644 libcli/util/doserr.h
 create mode 100644 libcli/util/error.h
 create mode 100644 libcli/util/errormap.c
 create mode 100644 libcli/util/nterr.c
 create mode 100644 libcli/util/ntstatus.h
 create mode 100644 libcli/util/werror.h
 delete mode 100755 source3/librpc/tables.pl
 delete mode 100644 source3/librpc/tools/ndrdump.c
 delete mode 100644 source4/libcli/util/doserr.c
 delete mode 100644 source4/libcli/util/doserr.h
 delete mode 100644 source4/libcli/util/error.h
 delete mode 100644 source4/libcli/util/errormap.c
 delete mode 100644 source4/libcli/util/nterr.c
 delete mode 100644 source4/libcli/util/ntstatus.h
 delete mode 100644 source4/libcli/util/werror.h


Changeset truncated at 500 lines:

diff --git a/lib/util/asn1_proto.h b/lib/util/asn1_proto.h
index bcaf2c2..9b7b4d2 100644
--- a/lib/util/asn1_proto.h
+++ b/lib/util/asn1_proto.h
@@ -1,5 +1,5 @@
-#ifndef ___LIB_UTIL_ASN1_PROTO_H__
-#define ___LIB_UTIL_ASN1_PROTO_H__
+#ifndef _____LIB_UTIL_ASN1_PROTO_H__
+#define _____LIB_UTIL_ASN1_PROTO_H__
 
 #undef _PRINTF_ATTRIBUTE
 #define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
@@ -10,7 +10,7 @@
  * used outside this particular subsystem! */
 
 
-/* The following definitions come from lib/util/asn1.c  */
+/* The following definitions come from ../lib/util/asn1.c  */
 
 struct asn1_data *asn1_init(TALLOC_CTX *mem_ctx);
 void asn1_free(struct asn1_data *data);
@@ -55,5 +55,5 @@ NTSTATUS asn1_full_tag(DATA_BLOB blob, uint8_t tag, size_t *packet_size);
 #undef _PRINTF_ATTRIBUTE
 #define _PRINTF_ATTRIBUTE(a1, a2)
 
-#endif /* ___LIB_UTIL_ASN1_PROTO_H__ */
+#endif /* _____LIB_UTIL_ASN1_PROTO_H__ */
 
diff --git a/libcli/util/doserr.c b/libcli/util/doserr.c
new file mode 100644
index 0000000..be33ba4
--- /dev/null
+++ b/libcli/util/doserr.c
@@ -0,0 +1,163 @@
+/* 
+ *  Unix SMB/CIFS implementation.
+ *  DOS error routines
+ *  Copyright (C) Tim Potter 2002.
+ *  
+ *  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 3 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  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, see <http://www.gnu.org/licenses/>.
+ */
+
+/* DOS error codes.  please read doserr.h */
+
+#include "includes.h"
+
+struct werror_code_struct {
+	const char *dos_errstr;
+	WERROR werror;
+};
+
+static const struct werror_code_struct dos_errs[] =
+{
+	{ "WERR_OK", WERR_OK },
+	{ "WERR_BADFILE", WERR_BADFILE },
+	{ "WERR_ACCESS_DENIED", WERR_ACCESS_DENIED },
+	{ "WERR_BADFID", WERR_BADFID },
+	{ "WERR_BADFUNC", WERR_BADFUNC },
+	{ "WERR_BAD_NETPATH", WERR_BAD_NETPATH },
+	{ "WERR_BAD_NET_RESP",  WERR_BAD_NET_RESP },
+	{ "WERR_UNEXP_NET_ERR", WERR_UNEXP_NET_ERR },
+	{ "WERR_INSUFFICIENT_BUFFER", WERR_INSUFFICIENT_BUFFER },
+	{ "WERR_NO_SUCH_SHARE", WERR_NO_SUCH_SHARE },
+	{ "WERR_FILE_EXISTS", WERR_FILE_EXISTS },
+	{ "WERR_INVALID_PARAM", WERR_INVALID_PARAM },
+	{ "WERR_NOT_SUPPORTED", WERR_NOT_SUPPORTED },
+	{ "WERR_DUP_NAME", WERR_DUP_NAME },
+	{ "WERR_BAD_PASSWORD", WERR_BAD_PASSWORD },
+	{ "WERR_NOMEM", WERR_NOMEM },
+	{ "WERR_INVALID_NAME", WERR_INVALID_NAME },
+	{ "WERR_UNKNOWN_LEVEL", WERR_UNKNOWN_LEVEL },
+	{ "WERR_OBJECT_PATH_INVALID", WERR_OBJECT_PATH_INVALID },
+	{ "WERR_ALREADY_EXISTS", WERR_ALREADY_EXISTS },
+	{ "WERR_NO_MORE_ITEMS", WERR_NO_MORE_ITEMS },
+	{ "WERR_MORE_DATA", WERR_MORE_DATA },
+	{ "WERR_UNKNOWN_PRINTER_DRIVER", WERR_UNKNOWN_PRINTER_DRIVER },
+	{ "WERR_INVALID_PRINTER_NAME", WERR_INVALID_PRINTER_NAME },
+	{ "WERR_PRINTER_ALREADY_EXISTS", WERR_PRINTER_ALREADY_EXISTS },
+	{ "WERR_INVALID_DATATYPE", WERR_INVALID_DATATYPE },
+	{ "WERR_INVALID_ENVIRONMENT", WERR_INVALID_ENVIRONMENT },
+	{ "WERR_INVALID_FORM_NAME", WERR_INVALID_FORM_NAME },
+	{ "WERR_INVALID_FORM_SIZE", WERR_INVALID_FORM_SIZE },
+	{ "WERR_ALREADY_SHARED", WERR_ALREADY_SHARED },
+	{ "WERR_BUF_TOO_SMALL", WERR_BUF_TOO_SMALL },
+	{ "WERR_JOB_NOT_FOUND", WERR_JOB_NOT_FOUND },
+	{ "WERR_DEST_NOT_FOUND", WERR_DEST_NOT_FOUND },
+	{ "WERR_NOT_LOCAL_DOMAIN", WERR_NOT_LOCAL_DOMAIN },
+	{ "WERR_DOMAIN_CONTROLLER_NOT_FOUND", WERR_DOMAIN_CONTROLLER_NOT_FOUND },
+	{ "WERR_TIME_DIFF_AT_DC", WERR_TIME_DIFF_AT_DC },
+	{ "WERR_SETUP_NOT_JOINED", WERR_SETUP_NOT_JOINED },
+	{ "WERR_SETUP_ALREADY_JOINED", WERR_SETUP_ALREADY_JOINED },
+	{ "WERR_SETUP_DOMAIN_CONTROLLER", WERR_SETUP_DOMAIN_CONTROLLER },
+	{ "WERR_DEVICE_NOT_AVAILABLE", WERR_DEVICE_NOT_AVAILABLE },
+	{ "WERR_PRINTER_DRIVER_IN_USE", WERR_PRINTER_DRIVER_IN_USE },
+	{ "WERR_STATUS_MORE_ENTRIES", WERR_STATUS_MORE_ENTRIES },
+	{ "WERR_NET_NAME_NOT_FOUND", WERR_NET_NAME_NOT_FOUND },
+	{ "WERR_DEVICE_NOT_SHARED", WERR_DEVICE_NOT_SHARED },
+	{ "WERR_DFS_NO_SUCH_VOL", WERR_DFS_NO_SUCH_VOL },
+	{ "WERR_DFS_NO_SUCH_SHARE", WERR_DFS_NO_SUCH_SHARE },
+	{ "WERR_DFS_NO_SUCH_SERVER", WERR_DFS_NO_SUCH_SERVER },
+	{ "WERR_DFS_INTERNAL_ERROR", WERR_DFS_INTERNAL_ERROR },
+	{ "WERR_DFS_CANT_CREATE_JUNCT", WERR_DFS_CANT_CREATE_JUNCT },
+	{ "WERR_LOGON_FAILURE", WERR_LOGON_FAILURE },
+	{ "WERR_INVALID_SECURITY_DESCRIPTOR", WERR_INVALID_SECURITY_DESCRIPTOR },
+	{ "WERR_INVALID_DOMAIN_ROLE", WERR_INVALID_DOMAIN_ROLE },
+	{ "WERR_UNKNOWN_REVISION", WERR_UNKNOWN_REVISION },
+	{ "WERR_REVISION_MISMATCH", WERR_REVISION_MISMATCH },
+	{ "WERR_INVALID_OWNER", WERR_INVALID_OWNER },
+	{ "WERR_INVALID_COMPUTERNAME", WERR_INVALID_COMPUTERNAME },
+	{ "WERR_INVALID_DOMAINNAME", WERR_INVALID_DOMAINNAME },
+	{ "WERR_NO_LOGON_SERVERS", WERR_NO_LOGON_SERVERS },
+	{ "WERR_NO_SUCH_LOGON_SESSION", WERR_NO_SUCH_LOGON_SESSION },
+	{ "WERR_NO_SUCH_PRIVILEGE", WERR_NO_SUCH_PRIVILEGE },
+	{ "WERR_PRIVILEGE_NOT_HELD", WERR_PRIVILEGE_NOT_HELD },
+	{ "WERR_NO_SUCH_USER", WERR_NO_SUCH_USER },
+	{ "WERR_NO_SUCH_DOMAIN", WERR_NO_SUCH_DOMAIN },
+	{ "WERR_NO_SYSTEM_RESOURCES", WERR_NO_SYSTEM_RESOURCES },
+	{ "WERR_DS_SERVICE_BUSY", WERR_DS_SERVICE_BUSY },
+	{ "WERR_DS_SERVICE_UNAVAILABLE", WERR_DS_SERVICE_UNAVAILABLE },
+	{ "WERR_DS_NO_SUCH_OBJECT", WERR_DS_NO_SUCH_OBJECT },
+	{ "WERR_DS_OBJ_NOT_FOUND", WERR_DS_OBJ_NOT_FOUND },
+	{ "WERR_DS_SCHEMA_NOT_LOADED", WERR_DS_SCHEMA_NOT_LOADED },
+	{ "WERR_DS_SCHEMA_ALLOC_FAILED", WERR_DS_SCHEMA_ALLOC_FAILED },
+	{ "WERR_DS_ATT_SCHEMA_REQ_SYNTAX", WERR_DS_ATT_SCHEMA_REQ_SYNTAX },
+	{ "WERR_DS_DRA_SCHEMA_MISMATCH", WERR_DS_DRA_SCHEMA_MISMATCH },
+	{ "WERR_DS_DRA_INVALID_PARAMETER", WERR_DS_DRA_INVALID_PARAMETER },
+	{ "WERR_DS_DRA_BAD_DN", WERR_DS_DRA_BAD_DN },
+	{ "WERR_DS_DRA_BAD_NC", WERR_DS_DRA_BAD_NC },
+	{ "WERR_DS_DRA_INTERNAL_ERROR", WERR_DS_DRA_INTERNAL_ERROR },
+	{ "WERR_DS_DRA_OUT_OF_MEM", WERR_DS_DRA_OUT_OF_MEM },
+	{ "WERR_DS_SINGLE_VALUE_CONSTRAINT", WERR_DS_SINGLE_VALUE_CONSTRAINT },
+	{ "WERR_DS_DRA_DB_ERROR", WERR_DS_DRA_DB_ERROR },
+	{ "WERR_DS_DRA_NO_REPLICA", WERR_DS_DRA_NO_REPLICA },
+	{ "WERR_DS_DRA_ACCESS_DENIED", WERR_DS_DRA_ACCESS_DENIED },
+	{ "WERR_DS_DNS_LOOKUP_FAILURE", WERR_DS_DNS_LOOKUP_FAILURE },
+	{ "WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX", WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX },
+	{ "WERR_DS_NO_MSDS_INTID", WERR_DS_NO_MSDS_INTID },
+	{ "WERR_DS_DUP_MSDS_INTID", WERR_DS_DUP_MSDS_INTID },
+	{ "WERR_GENERAL_FAILURE", WERR_GENERAL_FAILURE },
+	{ "WERR_PRINTQ_FULL", WERR_PRINTQ_FULL },
+	{ "WERR_NO_SPOOL_SPACE", WERR_NO_SPOOL_SPACE },
+	{ "WERR_CAN_NOT_COMPLETE", WERR_CAN_NOT_COMPLETE },
+	{ "WERR_INVALID_FLAGS", WERR_INVALID_FLAGS },
+	{ "WERR_NOT_FOUND", WERR_NOT_FOUND },
+	{ "WERR_SERVER_UNAVAILABLE", WERR_SERVER_UNAVAILABLE },
+	{ "WERR_CLASS_NOT_REGISTERED", WERR_CLASS_NOT_REGISTERED },
+	{ "WERR_NO_SHUTDOWN_IN_PROGRESS", WERR_NO_SHUTDOWN_IN_PROGRESS },
+	{ "WERR_SHUTDOWN_ALREADY_IN_PROGRESS", WERR_SHUTDOWN_ALREADY_IN_PROGRESS },
+	{ "WERR_SEC_E_ENCRYPT_FAILURE",	WERR_SEC_E_ENCRYPT_FAILURE },
+	{ "WERR_SEC_E_DECRYPT_FAILURE",	WERR_SEC_E_DECRYPT_FAILURE },
+	{ "WERR_SEC_E_ALGORITHM_MISMATCH", WERR_SEC_E_ALGORITHM_MISMATCH },
+	{ "WERR_NOT_AUTHENTICATED", WERR_NOT_AUTHENTICATED },
+	{ "WERR_CALL_NOT_IMPLEMENTED", WERR_CALL_NOT_IMPLEMENTED },
+	{ "WERR_FRS_INVALID_SERVICE_PARAMETER", WERR_FRS_INVALID_SERVICE_PARAMETER },
+	{ "WERR_FRS_SYSVOL_IS_BUSY", WERR_FRS_SYSVOL_IS_BUSY },
+	{ "WERR_FRS_INSUFFICIENT_PRIV", WERR_FRS_INSUFFICIENT_PRIV },
+	{ "WERR_RPC_E_REMOTE_DISABLED", WERR_RPC_E_REMOTE_DISABLED },
+	{ "WERR_NOT_CONNECTED", WERR_NOT_CONNECTED },
+	{ "WERR_NAME_NOT_FOUND", WERR_NAME_NOT_FOUND},
+	{ NULL, W_ERROR(0) }
+};
+
+
+
+
+/* DFS errors */
+
+/*****************************************************************************
+ returns a windows error message.  not amazingly helpful, but better than a number.
+ *****************************************************************************/
+const char *win_errstr(WERROR werror)
+{
+        static char msg[40];
+        int idx = 0;
+
+	while (dos_errs[idx].dos_errstr != NULL) {
+		if (W_ERROR_V(dos_errs[idx].werror) == 
+                    W_ERROR_V(werror))
+                        return dos_errs[idx].dos_errstr;
+		idx++;
+	}
+
+	slprintf(msg, sizeof(msg), "DOS code 0x%08x", W_ERROR_V(werror));
+
+        return msg;
+}
diff --git a/libcli/util/doserr.h b/libcli/util/doserr.h
new file mode 100644
index 0000000..12cca12
--- /dev/null
+++ b/libcli/util/doserr.h
@@ -0,0 +1,176 @@
+/* 
+   Unix SMB/CIFS implementation.
+   DOS error code constants
+   Copyright (C) Andrew Tridgell              1992-2000
+   Copyright (C) John H Terpstra              1996-2000
+   Copyright (C) Luke Kenneth Casson Leighton 1996-2000
+   Copyright (C) Paul Ashton                  1998-2000
+   Copyright (C) Gerald (Jerry) Carter        2005
+   
+   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 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   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, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _DOSERR_H
+#define _DOSERR_H
+
+/* Error classes */
+
+#define ERRDOS 0x01 /*  Error is from the core DOS operating system set. */
+#define ERRSRV 0x02  /* Error is generated by the server network file manager.*/
+#define ERRHRD 0x03  /* Error is an hardware error. */
+#define ERRCMD 0xFF  /* Command was not in the "SMB" format. */
+
+/* SMB X/Open error codes for the ERRDOS error class */
+#define ERRsuccess 0 /* No error */
+#define ERRbadfunc 1 /* Invalid function (or system call) */
+#define ERRbadfile 2 /* File not found (pathname error) */
+#define ERRbadpath 3 /* Directory not found */
+#define ERRnofids 4 /* Too many open files */
+#define ERRnoaccess 5 /* Access denied */
+#define ERRbadfid 6 /* Invalid fid */
+#define ERRbadmcb 7 /* Memory control blocks destroyed. */
+#define ERRnomem 8 /* Out of memory */
+#define ERRbadmem 9 /* Invalid memory block address */
+#define ERRbadenv 10 /* Invalid environment */
+#define ERRbadformat 11 /* Bad Format */
+#define ERRbadaccess 12 /* Invalid open mode */
+#define ERRbaddata 13 /* Invalid data (only from ioctl call) */
+#define ERRres 14 /* reserved */
+#define ERRbaddrive 15 /* Invalid drive */
+#define ERRremcd 16 /* Attempt to delete current directory */
+#define ERRdiffdevice 17 /* rename/move across different filesystems */
+#define ERRnofiles 18 /* no more files found in file search */
+#define ERRgeneral 31 /* General failure */
+#define ERRbadshare 32 /* Share mode on file conflict with open mode */
+#define ERRlock 33 /* Lock request conflicts with existing lock */
+#define ERRunsup 50 /* Request unsupported, returned by Win 95, RJS 20Jun98 */
+#define ERRnetnamedel 64 /* Network name deleted or not available */
+#define ERRnosuchshare 67 /* You specified an invalid share name */
+#define ERRfilexists 80 /* File in operation already exists */
+#define ERRinvalidparam 87
+#define ERRcannotopen 110 /* Cannot open the file specified */
+#define ERRbufferoverflow 111
+#define ERRinsufficientbuffer 122
+#define ERRinvalidname 123 /* Invalid name */
+#define ERRunknownlevel 124
+#define ERRnotlocked 158 /* This region is not locked by this locking context. */
+#define ERRinvalidpath 161
+#define ERRcancelviolation 173
+#define ERRnoatomiclocks 174
+#define ERRrename 183
+#define ERRbadpipe 230 /* Named pipe invalid */
+#define ERRpipebusy 231 /* All instances of pipe are busy */
+#define ERRpipeclosing 232 /* named pipe close in progress */
+#define ERRnotconnected 233 /* No process on other end of named pipe */
+#define ERRmoredata 234 /* More data to be returned */
+#define ERReainconsistent 255 /* from EMC */
+#define ERRnomoreitems 259
+#define ERRbaddirectory 267 /* Invalid directory name in a path. */
+#define ERReasnotsupported 282 /* Extended attributes */
+#define ERRlogonfailure 1326 /* Unknown username or bad password */
+#define ERRbuftoosmall 2123
+#define ERRunknownipc 2142
+#define ERRnosuchprintjob 2151
+#define ERRinvgroup 2455
+
+/* here's a special one from observing NT */
+#define ERRnoipc 66 /* don't support ipc */
+
+/* These errors seem to be only returned by the NT printer driver system */
+#define ERRdriveralreadyinstalled 1795 /* ERROR_PRINTER_DRIVER_ALREADY_INSTALLED */
+#define ERRunknownprinterport 1796 /* ERROR_UNKNOWN_PORT */
+#define ERRunknownprinterdriver 1797 /* ERROR_UNKNOWN_PRINTER_DRIVER */
+#define ERRunknownprintprocessor 1798 /* ERROR_UNKNOWN_PRINTPROCESSOR */
+#define ERRinvalidseparatorfile 1799 /* ERROR_INVALID_SEPARATOR_FILE */
+#define ERRinvalidjobpriority 1800 /* ERROR_INVALID_PRIORITY */
+#define ERRinvalidprintername 1801 /* ERROR_INVALID_PRINTER_NAME */
+#define ERRprinteralreadyexists 1802 /* ERROR_PRINTER_ALREADY_EXISTS */
+#define ERRinvalidprintercommand 1803 /* ERROR_INVALID_PRINTER_COMMAND */
+#define ERRinvaliddatatype 1804 /* ERROR_INVALID_DATATYPE */
+#define ERRinvalidenvironment 1805 /* ERROR_INVALID_ENVIRONMENT */
+
+#define ERRunknownprintmonitor 3000 /* ERROR_UNKNOWN_PRINT_MONITOR */
+#define ERRprinterdriverinuse 3001 /* ERROR_PRINTER_DRIVER_IN_USE */
+#define ERRspoolfilenotfound 3002 /* ERROR_SPOOL_FILE_NOT_FOUND */
+#define ERRnostartdoc 3003 /* ERROR_SPL_NO_STARTDOC */
+#define ERRnoaddjob 3004 /* ERROR_SPL_NO_ADDJOB */
+#define ERRprintprocessoralreadyinstalled 3005 /* ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED */
+#define ERRprintmonitoralreadyinstalled 3006 /* ERROR_PRINT_MONITOR_ALREADY_INSTALLED */
+#define ERRinvalidprintmonitor 3007 /* ERROR_INVALID_PRINT_MONITOR */
+#define ERRprintmonitorinuse 3008 /* ERROR_PRINT_MONITOR_IN_USE */
+#define ERRprinterhasjobsqueued 3009 /* ERROR_PRINTER_HAS_JOBS_QUEUED */
+
+/* Error codes for the ERRSRV class */
+
+#define ERRerror 1 /* Non specific error code */
+#define ERRbadpw 2 /* Bad password */
+#define ERRbadtype 3 /* reserved */
+#define ERRaccess 4 /* No permissions to do the requested operation */
+#define ERRinvnid 5 /* tid invalid */
+#define ERRinvnetname 6 /* Invalid servername */
+#define ERRinvdevice 7 /* Invalid device */
+#define ERRqfull 49 /* Print queue full */
+#define ERRqtoobig 50 /* Queued item too big */
+#define ERRinvpfid 52 /* Invalid print file in smb_fid */
+#define ERRsmbcmd 64 /* Unrecognised command */
+#define ERRsrverror 65 /* smb server internal error */
+#define ERRfilespecs 67 /* fid and pathname invalid combination */
+#define ERRbadlink 68 /* reserved */
+#define ERRbadpermits 69 /* Access specified for a file is not valid */
+#define ERRbadpid 70 /* reserved */
+#define ERRsetattrmode 71 /* attribute mode invalid */
+#define ERRpaused 81 /* Message server paused */
+#define ERRmsgoff 82 /* Not receiving messages */
+#define ERRnoroom 83 /* No room for message */
+#define ERRrmuns 87 /* too many remote usernames */
+#define ERRtimeout 88 /* operation timed out */
+#define ERRnoresource  89 /* No resources currently available for request. */
+#define ERRtoomanyuids 90 /* too many userids */
+#define ERRbaduid 91 /* bad userid */
+#define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
+#define ERRuseSTD 251 /* temporarily unable to use raw mode, use standard mode */
+#define ERRcontMPX 252 /* resume MPX mode */
+#define ERRbadPW /* reserved */
+#define ERRnosupport 0xFFFF
+#define ERRunknownsmb 22 /* from NT 3.5 response */
+
+/* Error codes for the ERRHRD class */
+
+#define ERRnowrite 19 /* read only media */
+#define ERRbadunit 20 /* Unknown device */
+#define ERRnotready 21 /* Drive not ready */
+#define ERRbadcmd 22 /* Unknown command */
+#define ERRdata 23 /* Data (CRC) error */
+#define ERRbadreq 24 /* Bad request structure length */
+#define ERRseek 25
+#define ERRbadmedia 26
+#define ERRbadsector 27
+#define ERRnopaper 28
+#define ERRwrite 29 /* write fault */
+#define ERRread 30 /* read fault */
+#define ERRgeneral 31 /* General hardware failure */
+#define ERRwrongdisk 34
+#define ERRFCBunavail 35
+#define ERRsharebufexc 36 /* share buffer exceeded */
+#define ERRdiskfull 39
+
+#ifndef NERR_BASE
+#define NERR_BASE (2100)
+#endif
+
+#ifndef FRS_ERR_BASE
+#define FRS_ERR_BASE (8000)
+#endif
+
+#endif /* _DOSERR_H */
diff --git a/libcli/util/error.h b/libcli/util/error.h
new file mode 100644
index 0000000..8425544
--- /dev/null
+++ b/libcli/util/error.h
@@ -0,0 +1,56 @@
+/* 
+   Unix SMB/CIFS implementation.   
+   Error handling code
+   
+   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 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   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, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _SAMBA_ERROR_H_
+#define _SAMBA_ERROR_H_
+
+#include "libcli/util/werror.h"
+#include "libcli/util/doserr.h"
+#include "libcli/util/ntstatus.h"
+
+/** NT error on DOS connection! (NT_STATUS_OK) */
+bool ntstatus_dos_equal(NTSTATUS status1, NTSTATUS status2);
+
+/*****************************************************************************
+convert a NT status code to a dos class/code
+ *****************************************************************************/
+void ntstatus_to_dos(NTSTATUS ntstatus, uint8_t *eclass, uint32_t *ecode);
+
+/*****************************************************************************
+convert a WERROR to a NT status32 code
+ *****************************************************************************/
+NTSTATUS werror_to_ntstatus(WERROR error);
+
+/*****************************************************************************
+convert a NTSTATUS to a WERROR
+ *****************************************************************************/
+WERROR ntstatus_to_werror(NTSTATUS error);
+
+/*********************************************************************
+ Map an NT error code from a Unix error code.
+*********************************************************************/
+NTSTATUS map_nt_error_from_unix(int unix_error);
+
+enum ndr_err_code;
+
+/*********************************************************************
+ Map an NT error code from a NDR error code.
+*********************************************************************/
+NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err);
+
+#endif /* _SAMBA_ERROR_H */
diff --git a/libcli/util/errormap.c b/libcli/util/errormap.c
new file mode 100644
index 0000000..2257955
--- /dev/null
+++ b/libcli/util/errormap.c
@@ -0,0 +1,1403 @@
+/* 
+ *  Unix SMB/CIFS implementation.
+ *  error mapping functions
+ *  Copyright (C) Andrew Tridgell 2001
+ *  Copyright (C) Andrew Bartlett 2001
+ *  Copyright (C) Tim Potter 2000
+ *  
+ *  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 3 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "includes.h"
+#include "param/param.h"
+#include "librpc/ndr/libndr.h"
+
+/* This map was extracted by the ERRMAPEXTRACT smbtorture command. 
+   The setup was a Samba HEAD (2002-01-03) PDC and an Win2k member 
+   workstation.  The PDC was modified (by using the 'name_to_nt_status'
+   authentication module) to convert the username (in hex) into the
+   corresponding NTSTATUS error return. 
+
+   By opening two nbt sessions to the Win2k workstation, one negotiating
+   DOS and one negotiating NT errors it was possible to extract the
+   error mapping.  (Because the server only supplies NT errors, the 
+   NT4 workstation had to use its own error tables to convert these
+   to dos errors). 
+
+   Some errors show up as 'squashed' because the NT error connection
+   got back a different error to the one it sent, so a mapping could
+   not be determined (a guess has been made in this case, to map the
+   error as squashed).  This is done mainly to prevent users from getting
+   NT_STATUS_WRONG_PASSWORD and NT_STATUS_NO_SUCH_USER errors (they get
+   NT_STATUS_LOGON_FAILURE instead.
+
+   -- abartlet (2002-01-03)
+*/
+
+/* NT status -> dos error map */
+static const struct {
+	uint8_t dos_class;
+	uint32_t dos_code;
+	NTSTATUS ntstatus;
+} ntstatus_to_dos_map[] = {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list