]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-errormap: move map_nt_error_from_wbcErr() back into errormap.c
authorRalph Boehme <slow@samba.org>
Thu, 8 Feb 2024 11:09:33 +0000 (12:09 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 26 Jul 2024 10:06:31 +0000 (10:06 +0000)
This basically reverts commit 313db81ad3de6cf7759d6a0fc21ee32419b2e62b.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/include/proto.h
source3/libsmb/errormap.c
source3/libsmb/errormap_wbc.c [deleted file]
source3/libsmb/errormap_wbc.h [deleted file]

index b8e4b7de0f56d7ab493f279074d9e5b72d95dd5a..7ba9a18bd89cc302d4fe9d022cf754cc7598708a 100644 (file)
@@ -27,6 +27,7 @@
 #include <regex.h>
 
 #include "lib/util/access.h"
+#include "nsswitch/libwbclient/wbclient.h"
 
 /* The following definitions come from lib/adt_tree.c  */
 
@@ -581,6 +582,7 @@ void flush_negative_conn_cache_for_domain(const char *domain);
 /* The following definitions come from libsmb/errormap.c  */
 
 NTSTATUS dos_to_ntstatus(uint8_t eclass, uint32_t ecode);
+NTSTATUS map_nt_error_from_wbcErr(wbcErr wbc_err);
 
 /* The following definitions come from libsmb/namecache.c  */
 
index fd7d6a19e9a9e4fea73b7ecd6a55d96e1896c730..1db96d9003821fa98dcc9602253985934dac37b9 100644 (file)
@@ -293,3 +293,42 @@ NTSTATUS dos_to_ntstatus(uint8_t eclass, uint32_t ecode)
        }
        return NT_STATUS_UNSUCCESSFUL;
 }
+
+/*******************************************************************************
+ 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.c b/source3/libsmb/errormap_wbc.c
deleted file mode 100644 (file)
index ad523d6..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *  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
deleted file mode 100644 (file)
index 6323dee..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  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/>.
- */
-
-#ifndef _LIBSMB_ERRORMAP_WBC_H_
-#define _LIBSMB_ERRORMAP_WBC_H_
-
-/* The following definitions come from libsmb/errormap_wbc.c  */
-
-NTSTATUS map_nt_error_from_wbcErr(wbcErr wbc_err);
-
-#endif /* _LIBSMB_ERRORMAP_WBC_H_ */