From 1643c334db7f49a9c5ededf3422e4cc9ff17f253 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 5 Jan 2018 14:21:05 +0100 Subject: [PATCH] libsmb: Give dsgetdcname.c its own header Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/include/proto.h | 12 ------- source3/lib/netapi/getdc.c | 1 + source3/lib/netapi/joindomain.c | 1 + source3/lib/netapi/serverinfo.c | 1 + source3/libnet/libnet_join.c | 1 + source3/libsmb/dsgetdcname.c | 1 + source3/libsmb/dsgetdcname.h | 37 +++++++++++++++++++++ source3/rpc_server/netlogon/srv_netlog_nt.c | 1 + source3/utils/net_lookup.c | 1 + source3/utils/net_rpc.c | 1 + source3/winbindd/winbindd_dual_srv.c | 1 + 11 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 source3/libsmb/dsgetdcname.h diff --git a/source3/include/proto.h b/source3/include/proto.h index 3dab5d7ade6..4c51e4d3059 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -676,18 +676,6 @@ NTSTATUS check_negative_conn_cache( const char *domain, const char *server); void add_failed_connection_entry(const char *domain, const char *server, NTSTATUS result) ; void flush_negative_conn_cache_for_domain(const char *domain); -/* The following definitions come from libsmb/dsgetdcname.c */ - -struct netr_DsRGetDCNameInfo; - -NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx, - struct messaging_context *msg_ctx, - const char *domain_name, - const struct GUID *domain_guid, - const char *site_name, - uint32_t flags, - struct netr_DsRGetDCNameInfo **info); - /* The following definitions come from libsmb/errormap.c */ NTSTATUS dos_to_ntstatus(uint8_t eclass, uint32_t ecode); diff --git a/source3/lib/netapi/getdc.c b/source3/lib/netapi/getdc.c index 2d47ee45840..d4633752c78 100644 --- a/source3/lib/netapi/getdc.c +++ b/source3/lib/netapi/getdc.c @@ -24,6 +24,7 @@ #include "lib/netapi/netapi.h" #include "lib/netapi/netapi_private.h" #include "lib/netapi/libnetapi.h" +#include "libsmb/dsgetdcname.h" /******************************************************************** ********************************************************************/ diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index 7d27bd9d0fe..ff2154ba803 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -29,6 +29,7 @@ #include "../librpc/gen_ndr/ndr_wkssvc_c.h" #include "rpc_client/cli_pipe.h" #include "secrets.h" +#include "libsmb/dsgetdcname.h" /**************************************************************** ****************************************************************/ diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c index 2fd7668c682..7d9cc481c8c 100644 --- a/source3/lib/netapi/serverinfo.c +++ b/source3/lib/netapi/serverinfo.c @@ -26,6 +26,7 @@ #include "../librpc/gen_ndr/ndr_srvsvc_c.h" #include "lib/smbconf/smbconf.h" #include "lib/smbconf/smbconf_reg.h" +#include "libsmb/dsgetdcname.h" /**************************************************************** ****************************************************************/ diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 5bf0b7fff2d..a9405e8d288 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -44,6 +44,7 @@ #include "libcli/auth/netlogon_creds_cli.h" #include "auth/credentials/credentials.h" #include "krb5_env.h" +#include "libsmb/dsgetdcname.h" /**************************************************************** ****************************************************************/ diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c index 98649006324..3afe6a85b91 100644 --- a/source3/libsmb/dsgetdcname.c +++ b/source3/libsmb/dsgetdcname.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "libsmb/dsgetdcname.h" #include "libsmb/namequery.h" #include "libads/sitename_cache.h" #include "../librpc/gen_ndr/ndr_netlogon.h" diff --git a/source3/libsmb/dsgetdcname.h b/source3/libsmb/dsgetdcname.h new file mode 100644 index 00000000000..0aa06c32b83 --- /dev/null +++ b/source3/libsmb/dsgetdcname.h @@ -0,0 +1,37 @@ +/* + * Unix SMB/CIFS implementation. + * Copyright (C) Volker Lendecke 2018 + * + * 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 . + */ + +#ifndef __LIBSMB_DSGETDCNAME_H__ +#define __LIBSMB_DSGETDCNAME_H__ + +#include "replace.h" +#include +#include "librpc/gen_ndr/misc.h" + +struct netr_DsRGetDCNameInfo; +struct messaging_context; + +NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx, + struct messaging_context *msg_ctx, + const char *domain_name, + const struct GUID *domain_guid, + const char *site_name, + uint32_t flags, + struct netr_DsRGetDCNameInfo **info); + +#endif diff --git a/source3/rpc_server/netlogon/srv_netlog_nt.c b/source3/rpc_server/netlogon/srv_netlog_nt.c index 83e68417c76..9b9947455ed 100644 --- a/source3/rpc_server/netlogon/srv_netlog_nt.c +++ b/source3/rpc_server/netlogon/srv_netlog_nt.c @@ -47,6 +47,7 @@ #include "messages.h" #include "../lib/tsocket/tsocket.h" #include "lib/param/param.h" +#include "libsmb/dsgetdcname.h" extern userdom_struct current_user_info; diff --git a/source3/utils/net_lookup.c b/source3/utils/net_lookup.c index 4e7a74d1e00..05a3dbc6e2b 100644 --- a/source3/utils/net_lookup.c +++ b/source3/utils/net_lookup.c @@ -25,6 +25,7 @@ #include "smb_krb5.h" #include "../libcli/security/security.h" #include "passdb/lookup_sid.h" +#include "libsmb/dsgetdcname.h" int net_lookup_usage(struct net_context *c, int argc, const char **argv) { diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 52d313edfaa..b99a036fca1 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -47,6 +47,7 @@ #include "nsswitch/libwbclient/wbclient.h" #include "passdb.h" #include "../libcli/smb/smbXcli_base.h" +#include "libsmb/dsgetdcname.h" static int net_mode_share; static NTSTATUS sync_files(struct copy_clistate *cp_clistate, const char *mask); diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c index 4cea73feaf9..8cb05f06db6 100644 --- a/source3/winbindd/winbindd_dual_srv.c +++ b/source3/winbindd/winbindd_dual_srv.c @@ -35,6 +35,7 @@ #include "../source4/dsdb/samdb/samdb.h" #include "rpc_client/cli_netlogon.h" #include "rpc_client/util_netlogon.h" +#include "libsmb/dsgetdcname.h" void _wbint_Ping(struct pipes_struct *p, struct wbint_Ping *r) { -- 2.34.1