summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-10-28 11:03:15 +0100
committerGünther Deschner <gd@samba.org>2011-07-31 22:37:26 +0200
commitf9a5df89292eeab54b9eed4bacb5b11e7f31f1fb (patch)
tree3ec62ad9f7e978f201a2f44d6c3e16bbab7a2532 /source3/passdb
parentb0d9f620aa0182e4e3f60b19896e059f2cfa1ac1 (diff)
downloadsamba-f9a5df89292eeab54b9eed4bacb5b11e7f31f1fb.tar.gz
samba-f9a5df89292eeab54b9eed4bacb5b11e7f31f1fb.tar.bz2
samba-f9a5df89292eeab54b9eed4bacb5b11e7f31f1fb.zip
s3-passdb: add dummy calls to control global (replicated) secrets.
Guenther
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_interface.c68
-rw-r--r--source3/passdb/proto.h12
2 files changed, 80 insertions, 0 deletions
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 94ed355e2c..11c186a398 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -2283,6 +2283,70 @@ static struct pdb_domain_info *pdb_default_get_domain_info(
}
/*******************************************************************
+ secret methods
+ *******************************************************************/
+
+NTSTATUS pdb_get_secret(TALLOC_CTX *mem_ctx,
+ const char *secret_name,
+ DATA_BLOB *secret_current,
+ NTTIME *secret_current_lastchange,
+ DATA_BLOB *secret_old,
+ NTTIME *secret_old_lastchange,
+ struct security_descriptor **sd)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->get_secret(pdb, mem_ctx, secret_name,
+ secret_current, secret_current_lastchange,
+ secret_old, secret_old_lastchange,
+ sd);
+}
+
+NTSTATUS pdb_set_secret(const char *secret_name,
+ DATA_BLOB *secret_current,
+ DATA_BLOB *secret_old,
+ struct security_descriptor *sd)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->set_secret(pdb, secret_name,
+ secret_current,
+ secret_old,
+ sd);
+}
+
+NTSTATUS pdb_delete_secret(const char *secret_name)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->delete_secret(pdb, secret_name);
+}
+
+static NTSTATUS pdb_default_get_secret(struct pdb_methods *methods,
+ TALLOC_CTX *mem_ctx,
+ const char *secret_name,
+ DATA_BLOB *secret_current,
+ NTTIME *secret_current_lastchange,
+ DATA_BLOB *secret_old,
+ NTTIME *secret_old_lastchange,
+ struct security_descriptor **sd)
+{
+ return NT_STATUS_NOT_SUPPORTED;
+}
+
+static NTSTATUS pdb_default_set_secret(struct pdb_methods *methods,
+ const char *secret_name,
+ DATA_BLOB *secret_current,
+ DATA_BLOB *secret_old,
+ struct security_descriptor *sd)
+{
+ return NT_STATUS_NOT_SUPPORTED;
+}
+
+static NTSTATUS pdb_default_delete_secret(struct pdb_methods *methods,
+ const char *secret_name)
+{
+ return NT_STATUS_NOT_SUPPORTED;
+}
+
+/*******************************************************************
Create a pdb_methods structure and initialize it with the default
operations. In this way a passdb module can simply implement
the functionality it cares about. However, normally this is done
@@ -2353,5 +2417,9 @@ NTSTATUS make_pdb_method( struct pdb_methods **methods )
(*methods)->del_trusted_domain = pdb_default_del_trusted_domain;
(*methods)->enum_trusted_domains = pdb_default_enum_trusted_domains;
+ (*methods)->get_secret = pdb_default_get_secret;
+ (*methods)->set_secret = pdb_default_set_secret;
+ (*methods)->delete_secret = pdb_default_delete_secret;
+
return NT_STATUS_OK;
}
diff --git a/source3/passdb/proto.h b/source3/passdb/proto.h
index 8b95b72959..3699efe799 100644
--- a/source3/passdb/proto.h
+++ b/source3/passdb/proto.h
@@ -295,6 +295,18 @@ NTSTATUS pdb_del_trusted_domain(const char *domain);
NTSTATUS pdb_enum_trusted_domains(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
struct pdb_trusted_domain ***domains);
NTSTATUS make_pdb_method( struct pdb_methods **methods ) ;
+NTSTATUS pdb_get_secret(TALLOC_CTX *mem_ctx,
+ const char *secret_name,
+ DATA_BLOB *secret_current,
+ NTTIME *secret_current_lastchange,
+ DATA_BLOB *secret_old,
+ NTTIME *secret_old_lastchange,
+ struct security_descriptor **sd);
+NTSTATUS pdb_set_secret(const char *secret_name,
+ DATA_BLOB *secret_current,
+ DATA_BLOB *secret_old,
+ struct security_descriptor *sd);
+NTSTATUS pdb_delete_secret(const char *secret_name);
/* The following definitions come from passdb/pdb_ldap.c */