s3-winbind: Implemented samr backend function common_lockout_policy.
authorAndreas Schneider <asn@samba.org>
Wed, 9 Jun 2010 12:39:55 +0000 (14:39 +0200)
committerAndreas Schneider <asn@samba.org>
Mon, 5 Jul 2010 13:59:07 +0000 (15:59 +0200)
source3/winbindd/winbindd_samr.c

index ef825fdab4b8ededbd179c76d0a9e0c5a1a8638f..12fe447bfef95d21e46df5595c4219c58ec826b5 100644 (file)
@@ -1125,10 +1125,40 @@ error:
 
 static NTSTATUS common_lockout_policy(struct winbindd_domain *domain,
                                      TALLOC_CTX *mem_ctx,
-                                     struct samr_DomInfo12 *policy)
+                                     struct samr_DomInfo12 *lockout_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: lockout 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,
+                                            12,
+                                            &info);
+       if (!NT_STATUS_IS_OK(status)) {
+               goto error;
+       }
+
+       *lockout_policy = info->info12;
+
+error:
+       TALLOC_FREE(tmp_ctx);
+       return status;
 }
 
 static NTSTATUS common_password_policy(struct winbindd_domain *domain,