summaryrefslogtreecommitdiff
path: root/source3
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
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')
-rw-r--r--source3/Makefile.in1
-rw-r--r--source3/include/reg_objects.h1
-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
5 files changed, 66 insertions, 0 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 227650027a..45aa4cbc37 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -417,6 +417,7 @@ REGISTRY_OBJ = registry/reg_frontend.o registry/reg_cachehook.o registry/reg_pri
registry/reg_util.o registry/reg_dynamic.o registry/reg_perfcount.o \
registry/reg_smbconf.o registry/reg_api.o \
registry/reg_frontend_hilvl.o \
+ registry/reg_backend_netlogon_params.o \
$(UTIL_REG_API_OBJ) $(UTIL_REG_SMBCONF_OBJ)
RPC_LSA_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o librpc/gen_ndr/srv_lsa.o
diff --git a/source3/include/reg_objects.h b/source3/include/reg_objects.h
index 23a14e6757..3b846db681 100644
--- a/source3/include/reg_objects.h
+++ b/source3/include/reg_objects.h
@@ -100,6 +100,7 @@ typedef struct {
#define KEY_EVENTLOG "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog"
#define KEY_SHARES "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares"
#define KEY_SMBCONF "HKLM\\SOFTWARE\\Samba\\smbconf"
+#define KEY_NETLOGON_PARAMS "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters"
#define KEY_TREE_ROOT ""
/*
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 }
};