summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-01-18 09:40:42 +0100
committerMichael Adam <obnox@samba.org>2008-01-18 09:40:57 +0100
commit60fbc7e4f03bff29ad548c1e8640e6fde23ace2a (patch)
tree987c2ac713a3ca60dcd421f0f505172f8d9b805b /source3/registry
parent1ea809383ef310f442bae7b5d4591f9aa655ad60 (diff)
downloadsamba-60fbc7e4f03bff29ad548c1e8640e6fde23ace2a.tar.gz
samba-60fbc7e4f03bff29ad548c1e8640e6fde23ace2a.tar.bz2
samba-60fbc7e4f03bff29ad548c1e8640e6fde23ace2a.zip
Add a registry backend netlogon_params that replaces the former dynamic overlay.
This is the first step in replacing the dynamic overlays by proper backends implementing REGISTRY_OPS. Michael (This used to be commit e8a0524961d81fa83e0316905dc9d215e4aa7656)
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_backend_netlogon_params.c58
-rw-r--r--source3/registry/reg_dynamic.c4
-rw-r--r--source3/registry/reg_frontend.c2
3 files changed, 64 insertions, 0 deletions
diff --git a/source3/registry/reg_backend_netlogon_params.c b/source3/registry/reg_backend_netlogon_params.c
new file mode 100644
index 0000000000..b70e1bdf50
--- /dev/null
+++ b/source3/registry/reg_backend_netlogon_params.c
@@ -0,0 +1,58 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Netlogon parameters registry backend.
+ *
+ * This replaces the former dynamic netlogon parameters overlay.
+ */
+
+#include "includes.h"
+
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_REGISTRY
+
+
+static int netlogon_params_fetch_reg_values(const char *key,
+ REGVAL_CTR *regvals)
+{
+ uint32 dwValue;
+
+ if ( !pdb_get_account_policy(AP_REFUSE_MACHINE_PW_CHANGE, &dwValue) )
+ dwValue = 0;
+
+ regval_ctr_addvalue( regvals, "RefusePasswordChange", REG_DWORD,
+ (char*)&dwValue, sizeof(dwValue) );
+
+ return regval_ctr_numvals( regvals );
+}
+
+
+REGISTRY_OPS netlogon_params_reg_ops = {
+ NULL,
+ netlogon_params_fetch_reg_values,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
diff --git a/source3/registry/reg_dynamic.c b/source3/registry/reg_dynamic.c
index e70bd178f9..07c9673c28 100644
--- a/source3/registry/reg_dynamic.c
+++ b/source3/registry/reg_dynamic.c
@@ -29,6 +29,7 @@ struct reg_dyn_values {
int (*fetch_values) ( REGVAL_CTR *val );
};
+#if 0
/***********************************************************************
***********************************************************************/
@@ -44,6 +45,7 @@ static int netlogon_params( REGVAL_CTR *regvals )
return regval_ctr_numvals( regvals );
}
+#endif
/***********************************************************************
***********************************************************************/
@@ -200,7 +202,9 @@ static int current_version( REGVAL_CTR *values )
***********************************************************************/
static struct reg_dyn_values dynamic_values[] = {
+#if 0
{ "HKLM/SYSTEM/CURRENTCONTROLSET/SERVICES/NETLOGON/PARAMETERS", &netlogon_params },
+#endif
{ "HKLM/SYSTEM/CURRENTCONTROLSET/CONTROL/PRODUCTOPTIONS", &prod_options },
{ "HKLM/SYSTEM/CURRENTCONTROLSET/SERVICES/TCPIP/PARAMETERS", &tcpip_params },
{ "HKLM/SOFTWARE/MICROSOFT/WINDOWS NT/CURRENTVERSION/PERFLIB", &perflib_params },
diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c
index 9e84d3a8c4..6674b0ba20 100644
--- a/source3/registry/reg_frontend.c
+++ b/source3/registry/reg_frontend.c
@@ -28,6 +28,7 @@ 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 regdb_ops; /* these are the default */
/* array of REGISTRY_HOOK's which are read into a tree for easy access */
@@ -40,6 +41,7 @@ REGISTRY_HOOK reg_hooks[] = {
{ KEY_PRINTING_PORTS, &printing_ops },
{ KEY_SHARES, &shares_reg_ops },
{ KEY_SMBCONF, &smbconf_reg_ops },
+ { KEY_NETLOGON_PARAMS, &netlogon_params_reg_ops },
#endif
{ NULL, NULL }
};