From 42641d6321ca88efa07137af5ed17c3a17e9dcbf Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 21 Jan 2008 00:32:01 +0100 Subject: Extend/fix comments. Michael (This used to be commit 4952417fca89f5d797c861cde9fe74050ae02e2f) --- source3/Makefile.in | 2 +- source3/registry/reg_frontend.c | 101 -------------------------------------- source3/registry/reg_init_full.c | 103 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 102 deletions(-) delete mode 100644 source3/registry/reg_frontend.c create mode 100644 source3/registry/reg_init_full.c (limited to 'source3') diff --git a/source3/Makefile.in b/source3/Makefile.in index 674dd2aa40..df0c99d851 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -434,7 +434,7 @@ REGISTRY_BACKENDS = registry/reg_backend_printing.o \ registry/reg_backend_perflib.o -REGISTRY_OBJ = registry/reg_frontend.o registry/reg_cachehook.o \ +REGISTRY_OBJ = registry/reg_init_full.o registry/reg_cachehook.o \ registry/reg_eventlog.o \ registry/reg_util.o registry/reg_perfcount.o \ registry/reg_util_legacy.o \ diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c deleted file mode 100644 index fa210b4c05..0000000000 --- a/source3/registry/reg_frontend.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * Virtual Windows Registry Layer - * Copyright (C) Gerald Carter 2002-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 . - */ - -/* Implementation of registry frontend view functions. */ - -#include "includes.h" - -#undef DBGC_CLASS -#define DBGC_CLASS DBGC_REGISTRY - -extern REGISTRY_OPS printing_ops; -extern REGISTRY_OPS eventlog_ops; -extern REGISTRY_OPS shares_reg_ops; -extern REGISTRY_OPS smbconf_reg_ops; -extern REGISTRY_OPS netlogon_params_reg_ops; -extern REGISTRY_OPS prod_options_reg_ops; -extern REGISTRY_OPS tcpip_params_reg_ops; -extern REGISTRY_OPS hkpt_params_reg_ops; -extern REGISTRY_OPS current_version_reg_ops; -extern REGISTRY_OPS perflib_reg_ops; -extern REGISTRY_OPS regdb_ops; /* these are the default */ - -/* array of REGISTRY_HOOK's which are read into a tree for easy access */ -/* #define REG_TDB_ONLY 1 */ - -REGISTRY_HOOK reg_hooks[] = { -#ifndef REG_TDB_ONLY - { KEY_PRINTING, &printing_ops }, - { KEY_PRINTING_2K, &printing_ops }, - { KEY_PRINTING_PORTS, &printing_ops }, - { KEY_SHARES, &shares_reg_ops }, - { KEY_SMBCONF, &smbconf_reg_ops }, - { KEY_NETLOGON_PARAMS, &netlogon_params_reg_ops }, - { KEY_PROD_OPTIONS, &prod_options_reg_ops }, - { KEY_TCPIP_PARAMS, &tcpip_params_reg_ops }, - { KEY_HKPT, &hkpt_params_reg_ops }, - { KEY_CURRENT_VERSION, ¤t_version_reg_ops }, - { KEY_PERFLIB, &perflib_reg_ops }, -#endif - { NULL, NULL } -}; - -/*********************************************************************** - Open the registry database and initialize the REGISTRY_HOOK cache - ***********************************************************************/ - -bool init_registry( void ) -{ - int i; - bool ret = false; - TALLOC_CTX *frame = talloc_stackframe(); - - - if ( !regdb_init() ) { - DEBUG(0,("init_registry: failed to initialize the registry tdb!\n")); - goto fail; - } - - /* build the cache tree of registry hooks */ - - reghook_cache_init(); - - for ( i=0; reg_hooks[i].keyname; i++ ) { - if ( !reghook_cache_add(®_hooks[i]) ) - goto fail; - } - - if ( DEBUGLEVEL >= 20 ) - reghook_dump_cache(20); - - /* add any keys for other services */ - - svcctl_init_keys(); - eventlog_init_keys(); - perfcount_init_keys(); - - /* close and let each smbd open up as necessary */ - - regdb_close(); - - ret = true; - fail: - TALLOC_FREE(frame); - return ret; -} diff --git a/source3/registry/reg_init_full.c b/source3/registry/reg_init_full.c new file mode 100644 index 0000000000..b6a644bb11 --- /dev/null +++ b/source3/registry/reg_init_full.c @@ -0,0 +1,103 @@ +/* + * Unix SMB/CIFS implementation. + * Virtual Windows Registry Layer + * Copyright (C) Gerald Carter 2002-2005 + * Copyright (C) Michael Adam 2008 + * + * 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 . + */ + +/* Initialize the registry with all available backends. */ + +#include "includes.h" + +#undef DBGC_CLASS +#define DBGC_CLASS DBGC_REGISTRY + +extern REGISTRY_OPS printing_ops; +extern REGISTRY_OPS eventlog_ops; +extern REGISTRY_OPS shares_reg_ops; +extern REGISTRY_OPS smbconf_reg_ops; +extern REGISTRY_OPS netlogon_params_reg_ops; +extern REGISTRY_OPS prod_options_reg_ops; +extern REGISTRY_OPS tcpip_params_reg_ops; +extern REGISTRY_OPS hkpt_params_reg_ops; +extern REGISTRY_OPS current_version_reg_ops; +extern REGISTRY_OPS perflib_reg_ops; +extern REGISTRY_OPS regdb_ops; /* these are the default */ + +/* array of REGISTRY_HOOK's which are read into a tree for easy access */ +/* #define REG_TDB_ONLY 1 */ + +REGISTRY_HOOK reg_hooks[] = { +#ifndef REG_TDB_ONLY + { KEY_PRINTING, &printing_ops }, + { KEY_PRINTING_2K, &printing_ops }, + { KEY_PRINTING_PORTS, &printing_ops }, + { KEY_SHARES, &shares_reg_ops }, + { KEY_SMBCONF, &smbconf_reg_ops }, + { KEY_NETLOGON_PARAMS, &netlogon_params_reg_ops }, + { KEY_PROD_OPTIONS, &prod_options_reg_ops }, + { KEY_TCPIP_PARAMS, &tcpip_params_reg_ops }, + { KEY_HKPT, &hkpt_params_reg_ops }, + { KEY_CURRENT_VERSION, ¤t_version_reg_ops }, + { KEY_PERFLIB, &perflib_reg_ops }, +#endif + { NULL, NULL } +}; + +/*********************************************************************** + Open the registry database and initialize the REGISTRY_HOOK cache + with all available backens. + ***********************************************************************/ + +bool init_registry( void ) +{ + int i; + bool ret = false; + TALLOC_CTX *frame = talloc_stackframe(); + + + if ( !regdb_init() ) { + DEBUG(0,("init_registry: failed to initialize the registry tdb!\n")); + goto fail; + } + + /* build the cache tree of registry hooks */ + + reghook_cache_init(); + + for ( i=0; reg_hooks[i].keyname; i++ ) { + if ( !reghook_cache_add(®_hooks[i]) ) + goto fail; + } + + if ( DEBUGLEVEL >= 20 ) + reghook_dump_cache(20); + + /* add any keys for other services */ + + svcctl_init_keys(); + eventlog_init_keys(); + perfcount_init_keys(); + + /* close and let each smbd open up as necessary */ + + regdb_close(); + + ret = true; + fail: + TALLOC_FREE(frame); + return ret; +} -- cgit