* for use in places where not the whole registry is needed,
* e.g. utils/net_conf.c and loadparm.c
*/
-bool registry_init_smbconf(const char *keyname)
+WERROR registry_init_smbconf(const char *keyname)
{
WERROR werr;
- bool ret = false;
DEBUG(10, ("registry_init_smbconf called\n"));
keyname = KEY_SMBCONF;
}
- werr = regdb_init();
+ werr = registry_init_common();
if (!W_ERROR_IS_OK(werr)) {
- DEBUG(1, ("Failed to initialize the registry: %s\n",
- dos_errstr(werr)));
goto done;
}
goto done;
}
- werr = reghook_cache_init();
+ werr = reghook_cache_add(keyname, &smbconf_reg_ops);
if (!W_ERROR_IS_OK(werr)) {
- DEBUG(1, ("Failed to initialize the reghook cache: %s\n",
- dos_errstr(werr)));
+ DEBUG(1, ("Failed to add smbconf reghooks to reghook cache: "
+ "%s\n", dos_errstr(werr)));
goto done;
}
- if (!reghook_cache_add(keyname, &smbconf_reg_ops)) {
- DEBUG(1, ("Failed to add smbconf reghooks to reghook cache\n"));
- goto done;
- }
-
- ret = true;
-
done:
regdb_close();
- return ret;
+ return werr;
}