s3-errormap: move (unused) map_nt_error_from_wbcErr out of errormap.
authorGünther Deschner <gd@samba.org>
Thu, 24 Feb 2011 21:29:16 +0000 (22:29 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 25 Feb 2011 00:08:41 +0000 (01:08 +0100)
Guenther

source3/include/proto.h
source3/libsmb/errormap.c
source3/libsmb/errormap_wbc.c [new file with mode: 0644]
source3/libsmb/errormap_wbc.h [new file with mode: 0644]

index fe4a2c1e37dd8205c380f4c1254cdf13641269f7..ae048af19f6e9e62c209a0898466246b2791e759 100644 (file)
@@ -2602,7 +2602,6 @@ NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode);
 void ntstatus_to_dos(NTSTATUS ntstatus, uint8 *eclass, uint32 *ecode);
 NTSTATUS werror_to_ntstatus(WERROR error);
 WERROR ntstatus_to_werror(NTSTATUS error);
-NTSTATUS map_nt_error_from_wbcErr(wbcErr wbc_err);
 NTSTATUS map_nt_error_from_gss(uint32 gss_maj, uint32 minor);
 
 /* The following definitions come from libsmb/namecache.c  */
index babe6b993d6034dca727b9dc325b0cf921911ede..71efff37a5f7420ff8f199e0aaee175d6ec5f56a 100644 (file)
@@ -1506,45 +1506,6 @@ WERROR ntstatus_to_werror(NTSTATUS error)
        return W_ERROR(NT_STATUS_V(error) & 0xffff);
 }
 
-/*******************************************************************************
- Map between wbcErr and NT status.
-*******************************************************************************/
-
-static const struct {
-       wbcErr wbc_err;
-       NTSTATUS nt_status;
-} wbcErr_ntstatus_map[] = {
-       { WBC_ERR_SUCCESS,               NT_STATUS_OK },
-       { WBC_ERR_NOT_IMPLEMENTED,       NT_STATUS_NOT_IMPLEMENTED },
-       { WBC_ERR_UNKNOWN_FAILURE,       NT_STATUS_UNSUCCESSFUL },
-       { WBC_ERR_NO_MEMORY,             NT_STATUS_NO_MEMORY },
-       { WBC_ERR_INVALID_SID,           NT_STATUS_INVALID_SID },
-       { WBC_ERR_INVALID_PARAM,         NT_STATUS_INVALID_PARAMETER },
-       { WBC_ERR_WINBIND_NOT_AVAILABLE, NT_STATUS_SERVER_DISABLED },
-       { WBC_ERR_DOMAIN_NOT_FOUND,      NT_STATUS_NO_SUCH_DOMAIN },
-       { WBC_ERR_INVALID_RESPONSE,      NT_STATUS_INVALID_NETWORK_RESPONSE },
-       { WBC_ERR_NSS_ERROR,             NT_STATUS_INTERNAL_ERROR },
-       { WBC_ERR_AUTH_ERROR,            NT_STATUS_LOGON_FAILURE },
-       { WBC_ERR_UNKNOWN_USER,          NT_STATUS_NO_SUCH_USER },
-       { WBC_ERR_UNKNOWN_GROUP,         NT_STATUS_NO_SUCH_GROUP },
-       { WBC_ERR_PWD_CHANGE_FAILED,     NT_STATUS_PASSWORD_RESTRICTION }
-};
-
-NTSTATUS map_nt_error_from_wbcErr(wbcErr wbc_err)
-{
-       int i;
-
-       /* Look through list */
-       for (i=0;i<ARRAY_SIZE(wbcErr_ntstatus_map);i++) {
-               if (wbcErr_ntstatus_map[i].wbc_err == wbc_err) {
-                       return wbcErr_ntstatus_map[i].nt_status;
-               }
-       }
-
-       /* Default return */
-       return NT_STATUS_UNSUCCESSFUL;
-}
-
 
 #if defined(HAVE_GSSAPI)
 /*******************************************************************************
diff --git a/source3/libsmb/errormap_wbc.c b/source3/libsmb/errormap_wbc.c
new file mode 100644 (file)
index 0000000..b7e6ec0
--- /dev/null
@@ -0,0 +1,63 @@
+/* 
+ *  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 "nsswitch/libwbclient/wbclient.h"
+
+/*******************************************************************************
+ Map between wbcErr and NT status.
+*******************************************************************************/
+
+static const struct {
+       wbcErr wbc_err;
+       NTSTATUS nt_status;
+} wbcErr_ntstatus_map[] = {
+       { WBC_ERR_SUCCESS,               NT_STATUS_OK },
+       { WBC_ERR_NOT_IMPLEMENTED,       NT_STATUS_NOT_IMPLEMENTED },
+       { WBC_ERR_UNKNOWN_FAILURE,       NT_STATUS_UNSUCCESSFUL },
+       { WBC_ERR_NO_MEMORY,             NT_STATUS_NO_MEMORY },
+       { WBC_ERR_INVALID_SID,           NT_STATUS_INVALID_SID },
+       { WBC_ERR_INVALID_PARAM,         NT_STATUS_INVALID_PARAMETER },
+       { WBC_ERR_WINBIND_NOT_AVAILABLE, NT_STATUS_SERVER_DISABLED },
+       { WBC_ERR_DOMAIN_NOT_FOUND,      NT_STATUS_NO_SUCH_DOMAIN },
+       { WBC_ERR_INVALID_RESPONSE,      NT_STATUS_INVALID_NETWORK_RESPONSE },
+       { WBC_ERR_NSS_ERROR,             NT_STATUS_INTERNAL_ERROR },
+       { WBC_ERR_AUTH_ERROR,            NT_STATUS_LOGON_FAILURE },
+       { WBC_ERR_UNKNOWN_USER,          NT_STATUS_NO_SUCH_USER },
+       { WBC_ERR_UNKNOWN_GROUP,         NT_STATUS_NO_SUCH_GROUP },
+       { WBC_ERR_PWD_CHANGE_FAILED,     NT_STATUS_PASSWORD_RESTRICTION }
+};
+
+NTSTATUS map_nt_error_from_wbcErr(wbcErr wbc_err)
+{
+       int i;
+
+       /* Look through list */
+       for (i=0;i<ARRAY_SIZE(wbcErr_ntstatus_map);i++) {
+               if (wbcErr_ntstatus_map[i].wbc_err == wbc_err) {
+                       return wbcErr_ntstatus_map[i].nt_status;
+               }
+       }
+
+       /* Default return */
+       return NT_STATUS_UNSUCCESSFUL;
+}
+
diff --git a/source3/libsmb/errormap_wbc.h b/source3/libsmb/errormap_wbc.h
new file mode 100644 (file)
index 0000000..2042da4
--- /dev/null
@@ -0,0 +1,3 @@
+/* The following definitions come from libsmb/errormap_wbc.c  */
+
+NTSTATUS map_nt_error_from_wbcErr(wbcErr wbc_err);