2 * Unix SMB/CIFS implementation.
3 * Registry helper routines
4 * Copyright (C) Michael Adam 2007
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 3 of the License, or (at your option)
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, see <http://www.gnu.org/licenses/>.
22 #include "reg_cachehook.h"
23 #include "reg_backend_db.h"
24 #include "reg_init_basic.h"
27 #define DBGC_CLASS DBGC_REGISTRY
29 extern struct registry_ops smbconf_reg_ops
;
32 * init the smbconf portion of the registry.
33 * for use in places where not the whole registry is needed,
34 * e.g. utils/net_conf.c and loadparm.c
36 WERROR
registry_init_smbconf(const char *keyname
)
40 DEBUG(10, ("registry_init_smbconf called\n"));
42 if (keyname
== NULL
) {
43 DEBUG(10, ("registry_init_smbconf: defaulting to key '%s'\n",
45 keyname
= KEY_SMBCONF
;
48 werr
= registry_init_common();
49 if (!W_ERROR_IS_OK(werr
)) {
53 werr
= init_registry_key(keyname
);
54 if (!W_ERROR_IS_OK(werr
)) {
55 DEBUG(1, ("Failed to initialize registry key '%s': %s\n",
56 keyname
, win_errstr(werr
)));
60 werr
= reghook_cache_add(keyname
, &smbconf_reg_ops
);
61 if (!W_ERROR_IS_OK(werr
)) {
62 DEBUG(1, ("Failed to add smbconf reghooks to reghook cache: "
63 "%s\n", win_errstr(werr
)));