summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2010-06-09 14:41:54 +0200
committerAndreas Schneider <asn@samba.org>2010-07-05 15:59:07 +0200
commitc60a9e8077d875f7b4c9a11351f06506fafda133 (patch)
tree97debea4b45dd06d71c105d852cf9969216795ee
parent54e8f8bd578ce6c0df30eecde471190ee700dc32 (diff)
downloadsamba-c60a9e8077d875f7b4c9a11351f06506fafda133.tar.gz
samba-c60a9e8077d875f7b4c9a11351f06506fafda133.tar.bz2
samba-c60a9e8077d875f7b4c9a11351f06506fafda133.zip
s3-winbind: Implemented samr backend function common_password_policy.
-rw-r--r--source3/winbindd/winbindd_samr.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/source3/winbindd/winbindd_samr.c b/source3/winbindd/winbindd_samr.c
index 12fe447bfe..337ff99d42 100644
--- a/source3/winbindd/winbindd_samr.c
+++ b/source3/winbindd/winbindd_samr.c
@@ -1163,10 +1163,40 @@ error:
static NTSTATUS common_password_policy(struct winbindd_domain *domain,
TALLOC_CTX *mem_ctx,
- struct samr_DomInfo1 *policy)
+ struct samr_DomInfo1 *passwd_policy)
{
- /* TODO FIXME */
- return NT_STATUS_NOT_IMPLEMENTED;
+ struct rpc_pipe_client *samr_pipe;
+ struct policy_handle dom_pol;
+ union samr_DomainInfo *info = NULL;
+ TALLOC_CTX *tmp_ctx;
+ NTSTATUS status;
+
+ DEBUG(3,("samr: password policy\n"));
+
+ tmp_ctx = talloc_stackframe();
+ if (tmp_ctx == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto error;
+ }
+
+ status = rpccli_samr_QueryDomainInfo(samr_pipe,
+ mem_ctx,
+ &dom_pol,
+ 1,
+ &info);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto error;
+ }
+
+ *passwd_policy = info->info1;
+
+error:
+ TALLOC_FREE(tmp_ctx);
+ return status;
}
/* Lookup groups a user is a member of. I wish Unix had a call like this! */