summaryrefslogtreecommitdiff
path: root/source3/registry/reg_backend_netlogon_params.c
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/reg_backend_netlogon_params.c
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/reg_backend_netlogon_params.c')
-rw-r--r--source3/registry/reg_backend_netlogon_params.c58
1 files changed, 58 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
+};