errors: Merge ntstatus -> DOS error table between Samba3 and Samba4.
authorAndrew Bartlett <abartlet@samba.org>
Wed, 4 May 2011 03:47:26 +0000 (13:47 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 6 May 2011 05:51:24 +0000 (07:51 +0200)
They are now identical

Andrew Bartlett

source3/libsmb/errormap.c
source4/libcli/util/errormap.c

index bc9676bbff63ab42058aea69cc50e5dfa332f39c..d8c3cc0133d80331bda9bf1487c508ec12a4e208 100644 (file)
 
 /* NT status -> dos error map */
 static const struct {
-       uint8 dos_class;
-       uint32 dos_code;
+       uint8_t dos_class;
+       uint32_t dos_code;
        NTSTATUS ntstatus;
 } ntstatus_to_dos_map[] = {
+/*
+ * Not an official error, as only bit 0x80000000, not bits 0xC0000000 are set.
+ */
+       {ERRDOS,        ERRmoredata,    STATUS_BUFFER_OVERFLOW},
+       {ERRDOS,        ERRnofiles,     STATUS_NO_MORE_FILES},
+       {ERRDOS,        ERRnofiles,     NT_STATUS_NO_MORE_ENTRIES},
        {ERRDOS,        ERRgeneral,     NT_STATUS_UNSUCCESSFUL},
        {ERRDOS,        ERRbadfunc,     NT_STATUS_NOT_IMPLEMENTED},
        {ERRDOS,        87,     NT_STATUS_INVALID_INFO_CLASS},
@@ -105,11 +111,6 @@ static const struct {
 */
        {ERRDOS,        ERRnoaccess,    NT_STATUS_ACCESS_DENIED},
        {ERRDOS,        111,    NT_STATUS_BUFFER_TOO_SMALL},
-/*
- * Not an official error, as only bit 0x80000000, not bits 0xC0000000 are set.
- */
-       {ERRDOS,        ERRmoredata,    STATUS_BUFFER_OVERFLOW},
-       {ERRDOS,        ERRnofiles,     STATUS_NO_MORE_FILES},
        {ERRDOS,        ERRbadfid,      NT_STATUS_OBJECT_TYPE_MISMATCH},
        {ERRHRD,        ERRgeneral,     NT_STATUS_NONCONTINUABLE_EXCEPTION},
        {ERRHRD,        ERRgeneral,     NT_STATUS_INVALID_DISPOSITION},
@@ -1448,7 +1449,7 @@ NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode)
 /*****************************************************************************
 convert a NT status code to a dos class/code
  *****************************************************************************/
-void ntstatus_to_dos(NTSTATUS ntstatus, uint8 *eclass, uint32 *ecode)
+void ntstatus_to_dos(NTSTATUS ntstatus, uint8_t *eclass, uint32_t *ecode)
 {
        int i;
        if (NT_STATUS_IS_OK(ntstatus)) {
index 962dc24a45c85d819b673b852facbbf978811c96..ef0d48238850baf90f7f5d411cd6617dd9d4684d 100644 (file)
@@ -49,6 +49,10 @@ static const struct {
        uint32_t dos_code;
        NTSTATUS ntstatus;
 } ntstatus_to_dos_map[] = {
+/*
+ * Not an official error, as only bit 0x80000000, not bits 0xC0000000 are set.
+ */
+       {ERRDOS,        ERRmoredata,    STATUS_BUFFER_OVERFLOW},
        {ERRDOS,        ERRnofiles,     STATUS_NO_MORE_FILES},
        {ERRDOS,        ERRnofiles,     NT_STATUS_NO_MORE_ENTRIES},
        {ERRDOS,        ERRgeneral,     NT_STATUS_UNSUCCESSFUL},
@@ -63,7 +67,7 @@ static const struct {
        {ERRDOS,        193,    NT_STATUS_BAD_INITIAL_PC},
        {ERRDOS,        87,     NT_STATUS_INVALID_CID},
        {ERRHRD,        ERRgeneral,     NT_STATUS_TIMER_NOT_CANCELED},
-       {ERRDOS,        87,     NT_STATUS_INVALID_PARAMETER},
+       {ERRDOS,        ERRinvalidparam,        NT_STATUS_INVALID_PARAMETER},
        {ERRDOS,        ERRbadfile,     NT_STATUS_NO_SUCH_DEVICE},
        {ERRDOS,        ERRbadfile,     NT_STATUS_NO_SUCH_FILE},
        {ERRDOS,        ERRbadfunc,     NT_STATUS_INVALID_DEVICE_REQUEST},
@@ -116,13 +120,13 @@ static const struct {
        {ERRHRD,        ERRgeneral,     NT_STATUS_DISK_CORRUPT_ERROR},
        {ERRDOS,        ERRinvalidname, NT_STATUS_OBJECT_NAME_INVALID},
        {ERRDOS,        ERRbadfile,     NT_STATUS_OBJECT_NAME_NOT_FOUND},
-       {ERRDOS,        ERRfilexists,   NT_STATUS_OBJECT_NAME_COLLISION},
+       {ERRDOS,        183,    NT_STATUS_OBJECT_NAME_COLLISION},
        {ERRHRD,        ERRgeneral,     NT_STATUS_HANDLE_NOT_WAITABLE},
        {ERRDOS,        ERRbadfid,      NT_STATUS_PORT_DISCONNECTED},
        {ERRHRD,        ERRgeneral,     NT_STATUS_DEVICE_ALREADY_ATTACHED},
-       {ERRDOS,        161,    NT_STATUS_OBJECT_PATH_INVALID},
+       {ERRDOS,        ERRinvalidpath, NT_STATUS_OBJECT_PATH_INVALID},
        {ERRDOS,        ERRbadpath,     NT_STATUS_OBJECT_PATH_NOT_FOUND},
-       {ERRDOS,        161,    NT_STATUS_OBJECT_PATH_SYNTAX_BAD},
+       {ERRDOS,        ERRinvalidpath, NT_STATUS_OBJECT_PATH_SYNTAX_BAD},
        {ERRHRD,        ERRgeneral,     NT_STATUS_DATA_OVERRUN},
        {ERRHRD,        ERRgeneral,     NT_STATUS_DATA_LATE_ERROR},
        {ERRDOS,        23,     NT_STATUS_DATA_ERROR},
@@ -142,7 +146,7 @@ static const struct {
        {ERRDOS,        87,     NT_STATUS_BAD_WORKING_SET_LIMIT},
        {ERRDOS,        87,     NT_STATUS_INCOMPATIBLE_FILE_MAP},
        {ERRDOS,        87,     NT_STATUS_SECTION_PROTECTION},
-       {ERRDOS,        282,    NT_STATUS_EAS_NOT_SUPPORTED},
+       {ERRDOS,        ERReasnotsupported,     NT_STATUS_EAS_NOT_SUPPORTED},
        {ERRDOS,        255,    NT_STATUS_EA_TOO_LARGE},
        {ERRHRD,        ERRgeneral,     NT_STATUS_NONEXISTENT_EA_ENTRY},
        {ERRHRD,        ERRgeneral,     NT_STATUS_NO_EAS_ON_FILE},
@@ -335,7 +339,7 @@ static const struct {
        {ERRDOS,        203,    NT_STATUS(0xc0000100)},
        {ERRDOS,        145,    NT_STATUS_DIRECTORY_NOT_EMPTY},
        {ERRHRD,        ERRgeneral,     NT_STATUS_FILE_CORRUPT_ERROR},
-       {ERRDOS,        267,    NT_STATUS_NOT_A_DIRECTORY},
+       {ERRDOS,        ERRbaddirectory,        NT_STATUS_NOT_A_DIRECTORY},
        {ERRHRD,        ERRgeneral,     NT_STATUS_BAD_LOGON_SESSION_STATE},
        {ERRHRD,        ERRgeneral,     NT_STATUS_LOGON_SESSION_COLLISION},
        {ERRDOS,        206,    NT_STATUS_NAME_TOO_LONG},
@@ -404,7 +408,7 @@ static const struct {
        {ERRHRD,        ERRgeneral,     NT_STATUS_APP_INIT_FAILURE},
        {ERRHRD,        ERRgeneral,     NT_STATUS_PAGEFILE_CREATE_FAILED},
        {ERRHRD,        ERRgeneral,     NT_STATUS_NO_PAGEFILE},
-       {ERRDOS,        124,    NT_STATUS_INVALID_LEVEL},
+       {ERRDOS,        ERRunknownlevel,        NT_STATUS_INVALID_LEVEL},
        {ERRDOS,        86,     NT_STATUS_WRONG_PASSWORD_CORE},
        {ERRHRD,        ERRgeneral,     NT_STATUS_ILLEGAL_FLOAT_CONTEXT},
        {ERRDOS,        109,    NT_STATUS_PIPE_BROKEN},