]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
krb5_wrap: move source3/libads/krb5_errs.c to lib/krb5_wrap/krb5_errs.c
authorStefan Metzmacher <metze@samba.org>
Wed, 6 Nov 2019 14:38:23 +0000 (15:38 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 10 Feb 2020 16:32:37 +0000 (16:32 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
14 files changed:
lib/krb5_wrap/krb5_errs.c [moved from source3/libads/krb5_errs.c with 98% similarity]
lib/krb5_wrap/krb5_samba.h
lib/krb5_wrap/wscript_build
source3/libads/ads_status.c
source3/libads/authdata.c
source3/libads/kerberos.c
source3/libads/krb5_errs.h [deleted file]
source3/libnet/libnet_dssync.c
source3/libnet/libnet_dssync_keytab.c
source3/libsmb/cliconnect.c
source3/passdb/machine_account_secrets.c
source3/winbindd/winbindd_cred_cache.c
source3/winbindd/winbindd_pam.c
source3/wscript_build

similarity index 98%
rename from source3/libads/krb5_errs.c
rename to lib/krb5_wrap/krb5_errs.c
index 0c2ada59966bc6cb5fc62412745ac7a15a5844f5..37428defe1ef26e5e5c60cb221aa3dc5fdaa4775 100644 (file)
@@ -1,26 +1,24 @@
-/* 
+/*
  *  Unix SMB/CIFS implementation.
  *  Kerberos error mapping functions
  *  Copyright (C) Guenther Deschner 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/>.
  */
 
 #include "includes.h"
-#include "smb_krb5.h"
-
-#include "krb5_errs.h"
+#include "krb5_samba.h"
 
 #ifdef HAVE_KRB5
 
@@ -81,11 +79,11 @@ convert a KRB5 error to a NT status32 code
  NTSTATUS krb5_to_nt_status(krb5_error_code kerberos_error)
 {
        int i;
-       
+
        if (kerberos_error == 0) {
                return NT_STATUS_OK;
        }
-       
+
        for (i=0; NT_STATUS_V(krb5_to_nt_status_map[i].ntstatus); i++) {
                if (kerberos_error == krb5_to_nt_status_map[i].krb5_code)
                        return krb5_to_nt_status_map[i].ntstatus;
@@ -100,11 +98,11 @@ convert an NT status32 code to a KRB5 error
  krb5_error_code nt_status_to_krb5(NTSTATUS nt_status)
 {
        int i;
-       
+
        if NT_STATUS_IS_OK(nt_status) {
                return 0;
        }
-       
+
        for (i=0; NT_STATUS_V(nt_status_to_krb5_map[i].ntstatus); i++) {
                if (NT_STATUS_EQUAL(nt_status,nt_status_to_krb5_map[i].ntstatus))
                        return nt_status_to_krb5_map[i].krb5_code;
@@ -114,4 +112,3 @@ convert an NT status32 code to a KRB5 error
 }
 
 #endif
-
index 64ae0275dbdfac98ed5b5661544adf7f3e61370c..ca9a893e4f7eaa7b60d74bfa8da04332ca9ff431 100644 (file)
@@ -406,4 +406,7 @@ int ads_krb5_cli_get_ticket(TALLOC_CTX *mem_ctx,
                            time_t *tgs_expire,
                            const char *impersonate_princ_s);
 
+NTSTATUS krb5_to_nt_status(krb5_error_code kerberos_error);
+krb5_error_code nt_status_to_krb5(NTSTATUS nt_status);
+
 #endif /* _KRB5_SAMBA_H */
index 624964452afb406fc7066ee6f2e56f54d1bc7d8d..dd9fc08fff7117802d9ca64810931628722a9333 100644 (file)
@@ -5,7 +5,19 @@ if bld.CONFIG_SET('SAMBA4_USES_HEIMDAL'):
     add_deps = ' asn1'
 
 bld.SAMBA_LIBRARY('krb5samba',
-                  source='krb5_samba.c gss_samba.c keytab_util.c enctype_convert.c',
-                  deps='samba-util talloc krb5 com_err gssapi' + add_deps,
+                  source='''
+                      krb5_samba.c
+                      gss_samba.c
+                      keytab_util.c
+                      enctype_convert.c
+                      krb5_errs.c
+                  ''',
+                  deps='''
+                      samba-util
+                      talloc
+                      krb5
+                      com_err
+                      gssapi
+                  ''' + add_deps,
                   private_library=True
                  )
index fb3646386ca2f494ff0f92fc36a42b2fa2d7925e..70569949aeb2fa1dcfa0d448f6b9ab83fae44d3d 100644 (file)
@@ -25,7 +25,6 @@
 #include "system/gssapi.h"
 #include "smb_ldap.h"
 #include "libads/ads_status.h"
-#include "krb5_errs.h"
 
 /*
   build a ADS_STATUS structure
index 8d8c47fae4d8e48131f034319b9afabc24e51630..dd21d895fc2f1f0439b6923a5397c065193a0f95 100644 (file)
@@ -32,7 +32,6 @@
 #include "auth/gensec/gensec.h"
 #include "auth/gensec/gensec_internal.h" /* TODO: remove this */
 #include "../libcli/auth/spnego.h"
-#include "krb5_errs.h"
 
 #ifdef HAVE_KRB5
 
index 559ec3b7f538e89ac36db8ca8a2d721e5bd9a61a..5959da919b039f1ba2d0892a9e77cbde695aec93 100644 (file)
@@ -31,7 +31,6 @@
 #include "secrets.h"
 #include "../lib/tsocket/tsocket.h"
 #include "lib/util/asn1.h"
-#include "krb5_errs.h"
 
 #ifdef HAVE_KRB5
 
diff --git a/source3/libads/krb5_errs.h b/source3/libads/krb5_errs.h
deleted file mode 100644 (file)
index 57b6391..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *  Unix SMB/CIFS implementation.
- *  Kerberos error mapping functions
- *  Copyright (C) Guenther Deschner 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 __KRB5_ERRS_H__
-#define __KRB5_ERRS_H__
-
-#include "replace.h"
-#include "libcli/util/ntstatus.h"
-#include <krb5.h>
-
-NTSTATUS krb5_to_nt_status(krb5_error_code kerberos_error);
-krb5_error_code nt_status_to_krb5(NTSTATUS nt_status);
-
-#endif
index 2b6995bd56693c60f80bb261f0992f046442991f..e593ae8536cfd28d0ff741b80534a34df79139a4 100644 (file)
@@ -25,7 +25,6 @@
 #include "rpc_client/cli_pipe.h"
 #include "../libcli/drsuapi/drsuapi.h"
 #include "../librpc/gen_ndr/ndr_drsuapi_c.h"
-#include "libads/krb5_errs.h"
 
 /****************************************************************
 ****************************************************************/
index 7526cd3294e44c61922d424196532f60037e810f..8999a3535fb031bbd66ee9806c3403c9af5b350b 100644 (file)
@@ -23,7 +23,6 @@
 #include "libnet/libnet_dssync.h"
 #include "libnet/libnet_keytab.h"
 #include "librpc/gen_ndr/ndr_drsblobs.h"
-#include "libads/krb5_errs.h"
 
 #if defined(HAVE_ADS)
 
index 82d8384e91c6867a8fd5ad050c86bc2d2de4f37a..13d035a8d41e0b8477620ed81b0f4280d1c7626d 100644 (file)
@@ -41,7 +41,6 @@
 #include "../libcli/smb/smb_seal.h"
 #include "lib/param/param.h"
 #include "../libcli/smb/smb2_negotiate_context.h"
-#include "libads/krb5_errs.h"
 
 #define STAR_SMBSERVER "*SMBSERVER"
 
index efba80f147457575b5cc7351a9c6540c874bfba9..5cda8f065c4efe22102bd25e29c6efe0b333abf0 100644 (file)
@@ -37,7 +37,6 @@
 #include "lib/krb5_wrap/krb5_samba.h"
 #include "lib/util/time_basic.h"
 #include "../libds/common/flags.h"
-#include "libads/krb5_errs.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_PASSDB
index 5baecf906b940a9dcba577e4b9f2e40ae69e87b8..52aa0ff6aea1473f4f60c67064d2c8e4304434e7 100644 (file)
@@ -26,7 +26,6 @@
 #include "../libcli/auth/libcli_auth.h"
 #include "smb_krb5.h"
 #include "libads/kerberos_proto.h"
-#include "libads/krb5_errs.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
index a3d8716f781df341f6702872b597f49252f1109d..b5850a33b0f074fea0b1e1abedb33f07870611a6 100644 (file)
@@ -44,7 +44,6 @@
 #include "lib/afs/afs_funcs.h"
 #include "libsmb/samlogon_cache.h"
 #include "rpc_client/util_netlogon.h"
-#include "libads/krb5_errs.h"
 #include "param/param.h"
 #include "messaging/messaging.h"
 #include "lib/crypto/gnutls_helpers.h"
index 10d9f71ae7689534bb4c3f082148146fa73905ae..5dd0af73c8bd94a59f673743556b96e46ba3c13c 100644 (file)
@@ -406,7 +406,6 @@ bld.SAMBA3_SUBSYSTEM('samba3core',
                           lib/server_prefork.c
                           lib/server_prefork_util.c
                           lib/ldap_escape.c
-                          libads/krb5_errs.c
                           lib/system_smbd.c
                           lib/audit.c
                           lib/tevent_wait.c