1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

lib: give global_contexts.c its own header file

It's a bit shocking how many references we have to global
contexts. Make this a bit more obvious.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2021-01-03 21:53:49 +01:00 committed by Jeremy Allison
parent d0eaa14325
commit d82acf7685
56 changed files with 90 additions and 8 deletions

View File

@ -23,6 +23,7 @@
#include "param/param.h"
#include "../lib/messaging/messaging.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -28,6 +28,7 @@
#include "source4/lib/messaging/messaging.h"
#include "auth/gensec/gensec.h"
#include "auth/credentials/credentials.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -708,12 +708,6 @@ NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context,
const char *dcname,
bool force);
/* The following definitions come from lib/server_contexts.c */
struct tevent_context *global_event_context(void);
void global_event_context_free(void);
struct messaging_context *global_messaging_context(void);
void global_messaging_context_free(void);
/* The following definitions come from lib/sessionid_tdb.c */
struct sessionid;
NTSTATUS sessionid_traverse_read(int (*fn)(const char *key,

View File

@ -21,6 +21,7 @@
#include "cmdline_contexts.h"
#include "includes.h"
#include "messages.h"
#include "lib/global_contexts.h"
struct messaging_context *cmdline_messaging_context(const char *config_file)
{

View File

@ -29,7 +29,7 @@
#include "lib/messages_ctdb.h"
#include "util_tdb.h"
#include "ctdbd_conn.h"
#include "messages.h"
#include "global_contexts.h"
bool db_is_local(const char *name)
{

View File

@ -18,7 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
#include "replace.h"
#include "global_contexts.h"
#include <tevent.h>
#include "lib/util/fault.h"
#include "lib/util/samba_util.h"
#include "messages.h"
static struct tevent_context *global_event_ctx = NULL;

View File

@ -0,0 +1,31 @@
/*
* Unix SMB/CIFS implementation.
* Global contexts
*
* 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 __GLOBAL_CONTEXTS_H__
#define __GLOBAL_CONTEXTS_H__
struct tevent_context;
struct tevent_context *global_event_context(void);
void global_event_context_free(void);
struct messaging_context;
struct messaging_context *global_messaging_context(void);
void global_messaging_context_free(void);
#endif

View File

@ -56,6 +56,7 @@
#include "lib/util/tevent_ntstatus.h"
#include "g_lock.h"
#include "smbd/fd_handle.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_LOCKING

View File

@ -30,6 +30,7 @@
#include "lib/util/sys_rw_data.h"
#include "lib/util/msghdr.h"
#include "smbprofile.h"
#include "lib/global_contexts.h"
#if !defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL) && !defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS)
# error Can not pass file descriptors

View File

@ -21,6 +21,7 @@
#include "locking/share_mode_lock.h"
#include "smbd/smbd.h"
#include "lib/util/tevent_unix.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS

View File

@ -24,6 +24,7 @@
#include "lib/util/sys_rw.h"
#include "lib/util/sys_rw_data.h"
#include "lib/util/smb_strtox.h"
#include "lib/global_contexts.h"
struct preopen_state;

View File

@ -28,6 +28,7 @@
#include "../lib/util/pidfile.h"
#include "util_cluster.h"
#include "lib/gencache.h"
#include "lib/global_contexts.h"
int ClientNMB = -1;
int ClientDGRAM = -1;

View File

@ -38,6 +38,7 @@
#include "lib/util_sid_passdb.h"
#include "idmap_cache.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB

View File

@ -35,6 +35,7 @@
#include "rpc_server/spoolss/srv_spoolss_nt.h"
#include "rpc_client/cli_winreg_spoolss.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
/* Map generic permissions to printer object specific permissions */

View File

@ -38,6 +38,7 @@
#include "lib/param/loadparm.h"
#include "lib/util/sys_rw_data.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
extern userdom_struct current_user_info;

View File

@ -37,6 +37,7 @@
#include "auth.h"
#include "nt_printing.h"
#include "util_event.h"
#include "lib/global_contexts.h"
/**
* @brief Purge stale printers and reload from pre-populated pcap cache.

View File

@ -39,6 +39,7 @@
#include "librpc/rpc/dcesrv_core.h"
#include "lib/server_prefork.h"
#include "lib/server_prefork_util.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV

View File

@ -36,6 +36,7 @@
#include "librpc/rpc/dcesrv_core.h"
#include "librpc/gen_ndr/ndr_eventlog_scompat.h"
#include "rpc_server/eventlog/srv_eventlog_reg.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV

View File

@ -32,6 +32,7 @@
#include "librpc/gen_ndr/ndr_fsrvp.h"
#include "rpc_server/rpc_server.h"
#include "srv_fss_private.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV

View File

@ -42,6 +42,7 @@
#include "librpc/gen_ndr/ndr_lsa_scompat.h"
#include "librpc/gen_ndr/ndr_samr_scompat.h"
#include "librpc/gen_ndr/ndr_netlogon_scompat.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV

View File

@ -39,6 +39,7 @@
#include "rpc_server/mdssvc/srv_mdssvc_nt.h"
#include "rpc_server/mdssd.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV

View File

@ -34,6 +34,7 @@
#ifdef HAVE_SPOTLIGHT_BACKEND_ES
#include "mdssvc_es.h"
#endif
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV

View File

@ -34,6 +34,7 @@
#include "librpc/rpc/dcesrv_core.h"
#include "librpc/gen_ndr/ndr_mdssvc.h"
#include "librpc/gen_ndr/ndr_mdssvc_scompat.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV

View File

@ -23,6 +23,7 @@
#include "rpc_server/rpc_server.h"
#include "lib/param/param.h"
#include "librpc/rpc/dcesrv_core.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV

View File

@ -52,6 +52,7 @@
#include "lib/crypto/gnutls_helpers.h"
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV

View File

@ -64,6 +64,7 @@
#include "librpc/rpc/dcesrv_core.h"
#include "printing/nt_printing_migrate_internal.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
/* macros stolen from s4 spoolss server */
#define SPOOLSS_BUFFER_UNION(fn,info,level) \

View File

@ -41,6 +41,7 @@
#include "auth.h"
#include "messages.h"
#include "serverid.h"
#include "lib/global_contexts.h"
extern const struct generic_mapping file_generic_mapping;

View File

@ -37,6 +37,7 @@
#include "librpc/gen_ndr/ndr_svcctl.h"
#include "librpc/gen_ndr/ndr_svcctl_scompat.h"
#include "srv_svcctl_reg.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV

View File

@ -33,6 +33,7 @@
#include "libcli/security/security.h"
#include "librpc/gen_ndr/ndr_dfsblobs.h"
#include "lib/tsocket/tsocket.h"
#include "lib/global_contexts.h"
/**********************************************************************
Parse a DFS pathname of the form \hostname\service\reqpath

View File

@ -58,6 +58,7 @@
#include "rpc_server/lsasd.h"
#include "rpc_server/fssd.h"
#include "rpc_server/mdssd.h"
#include "lib/global_contexts.h"
#ifdef CLUSTER_SUPPORT
#include "ctdb_protocol.h"

View File

@ -38,6 +38,7 @@
#include "libcli/auth/netlogon_creds_cli.h"
#include "lib/gencache.h"
#include "rpc_server/rpc_config.h"
#include "lib/global_contexts.h"
static struct files_struct *log_writeable_file_fn(
struct files_struct *fsp, void *private_data)

View File

@ -38,6 +38,7 @@
#include "librpc/gen_ndr/ndr_smbXsrv.h"
#include "serverid.h"
#include "lib/util/tevent_ntstatus.h"
#include "lib/global_contexts.h"
struct smbXsrv_session_table {
struct {

View File

@ -24,6 +24,7 @@
#include "lib/dbwrap/dbwrap_ctdb.h"
#include "messages.h"
#include "lib/messages_ctdb.h"
#include "lib/global_contexts.h"
bool run_local_dbwrap_ctdb1(int dummy)
{

View File

@ -25,6 +25,7 @@
#include "lib/dbwrap/dbwrap_watch.h"
#include "lib/util/util_tdb.h"
#include "source3/include/util_tdb.h"
#include "lib/global_contexts.h"
struct do_locked1_state {
TDB_DATA value;

View File

@ -26,6 +26,7 @@
#include "lib/util/sys_rw.h"
#include "lib/util/util_tdb.h"
#include "lib/util/tevent_ntstatus.h"
#include "lib/global_contexts.h"
static bool get_g_lock_ctx(TALLOC_CTX *mem_ctx,
struct tevent_context **ev,

View File

@ -36,6 +36,7 @@
#include "libcli/security/security.h"
#include "lib/smbd_shim.h"
#include "system/filesys.h"
#include "lib/global_contexts.h"
/* List to hold groups of commands */
static struct cmd_list {

View File

@ -36,6 +36,7 @@
#include "lib/adouble.h"
#include "lib/string_replace.h"
#include "utils/net.h"
#include "lib/global_contexts.h"
#define NET_VFS_CMD_STREAM_TO_ADOUBLE "stream2adouble"

View File

@ -37,6 +37,7 @@
#include "serverid.h"
#include "cmdline_contexts.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
#ifdef HAVE_LIBUNWIND_H
#include <libunwind.h>

View File

@ -30,6 +30,7 @@
#include "idmap_rw.h"
#include "../libcli/security/security.h"
#include "lib/util/smb_strtox.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP

View File

@ -31,6 +31,7 @@
#include "nsswitch/winbind_client.h"
#include "lib/winbind_util.h"
#include "libcli/security/dom_sid.h"
#include "lib/global_contexts.h"
/*
* Config and connection info per domain.

View File

@ -50,6 +50,7 @@
#include "lib/util/tevent_req_profile.h"
#include "lib/gencache.h"
#include "rpc_server/rpc_config.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND

View File

@ -86,6 +86,7 @@
#include "lib/param/param.h"
#include "lib/gencache.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND

View File

@ -26,6 +26,7 @@
#include "../libcli/auth/libcli_auth.h"
#include "smb_krb5.h"
#include "libads/kerberos_proto.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND

View File

@ -20,6 +20,7 @@
#include "includes.h"
#include "winbindd.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
struct winbindd_domain_info_state {
struct winbindd_domain *domain;

View File

@ -42,6 +42,7 @@
#include "lib/util/sys_rw_data.h"
#include "passdb.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND

View File

@ -37,6 +37,7 @@
#include "rpc_client/cli_netlogon.h"
#include "rpc_client/util_netlogon.h"
#include "libsmb/dsgetdcname.h"
#include "lib/global_contexts.h"
void _wbint_Ping(struct pipes_struct *p, struct wbint_Ping *r)
{

View File

@ -20,6 +20,7 @@
#include "param/param.h"
#include "param/loadparm.h"
#include "winbindd.h"
#include "lib/global_contexts.h"
/*
* gpupdate_interval()

View File

@ -25,6 +25,7 @@
#include "winbindd.h"
#include "../libcli/security/security.h"
#include "passdb/lookup_sid.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND

View File

@ -31,6 +31,7 @@
#include "passdb/lookup_sid.h" /* only for LOOKUP_NAME_NO_NSS flag */
#include "librpc/gen_ndr/ndr_irpc.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "lib/global_contexts.h"
struct wb_irpc_forward_state {
struct irpc_message *msg;

View File

@ -51,6 +51,7 @@
#include "lib/crypto/gnutls_helpers.h"
#include <gnutls/crypto.h>
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND

View File

@ -21,6 +21,7 @@
#include "winbindd.h"
#include "libcli/security/dom_sid.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
struct winbindd_pam_auth_state {
struct winbindd_request *request;

View File

@ -22,6 +22,7 @@
#include "rpc_client/util_netlogon.h"
#include "libcli/security/dom_sid.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
struct winbindd_pam_auth_crap_state {
struct winbindd_response *response;

View File

@ -20,6 +20,7 @@
#include "includes.h"
#include "winbindd.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
struct winbindd_pam_chauthtok_state {
struct winbindd_request *request;

View File

@ -19,6 +19,7 @@
#include "includes.h"
#include "winbindd.h"
#include "lib/global_contexts.h"
struct winbindd_pam_chng_pswd_auth_crap_state {
struct winbindd_request *request;

View File

@ -19,6 +19,7 @@
#include "includes.h"
#include "winbindd.h"
#include "lib/global_contexts.h"
struct winbindd_pam_logoff_state {
struct winbindd_request *request;

View File

@ -35,6 +35,7 @@
#include "libsmb/samlogon_cache.h"
#include "lib/util/smb_strtox.h"
#include "lib/util/string_wrappers.h"
#include "lib/global_contexts.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND