[Freeipa-devel] CLDAP failures

Alexander Bokovoy abokovoy at redhat.com
Thu Jan 5 10:29:46 UTC 2012


On Thu, 22 Dec 2011, Simo Sorce wrote:

> On Thu, 2011-12-22 at 16:20 +0200, Alexander Bokovoy wrote:
> > Hi,
> > 
> > attached are two traces -- against IPA CLDAP plugin and AD win2k8.
> 
> 
> Please try the attached patch.
Tested and it works now for the same environment.
ACK.

https://fedorahosted.org/freeipa/ticket/2210

> 
> HTH,
> Simo.
> 
> -- 
> Simo Sorce * Red Hat, Inc * New York

> From b17b8bd67adf7d679ee1e9c4eed777091d6daecd Mon Sep 17 00:00:00 2001
> From: Simo Sorce <ssorce at redhat.com>
> Date: Thu, 22 Dec 2011 09:59:20 -0500
> Subject: [PATCH] ipa-cldap: Support clients asking for default domain
> 
> ---
>  .../ipa-cldap/ipa_cldap_netlogon.c                 |   22 +++++++++++++++++++-
>  1 files changed, 21 insertions(+), 1 deletions(-)
> 
> diff --git a/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_netlogon.c b/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_netlogon.c
> index 6eb7eb9b1b88bb190a75feeab39a2fe5ff2719bf..180a067ff8d95f984bd91233f5fb5811c9e140b5 100644
> --- a/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_netlogon.c
> +++ b/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_netlogon.c
> @@ -215,6 +215,7 @@ int ipa_cldap_netlogon(struct ipa_cldap_ctx *ctx,
>                         struct berval *reply)
>  {
>      char hostname[MAXHOSTNAMELEN + 1]; /* NOTE: lenght hardcoded in kernel */
> +    char domname[MAXHOSTNAMELEN + 1]; /* NOTE: lenght hardcoded in kernel */
>      char *domain = NULL;
>      char *guid = NULL;
>      char *sid = NULL;
> @@ -289,11 +290,30 @@ int ipa_cldap_netlogon(struct ipa_cldap_ctx *ctx,
>                    req->kvps.pairs[i].attr.bv_val);
>      }
>  
> -    if (!domain || !ntver) {
> +    if (!ntver) {
>          ret = EINVAL;
>          goto done;
>      }
>  
> +    /* If no domain is provide the client is asking for our own domain,
> +     * read our own domain name from the system */
> +    if (!domain) {
> +        ret = getdomainname(domname, MAXHOSTNAMELEN);
> +        if (ret == -1) {
> +            ret = errno;
> +            goto done;
> +        }
> +        domname[MAXHOSTNAMELEN] = '\0';
> +        p = strchr(hostname, '.');
> +        if (p) {
> +            domain = strdup(p + 1);
> +            if (!domain) {
> +                ret = ENOMEM;
> +                goto done;
> +            }
> +        }
> +    }
> +
>      /* FIXME: we support only NETLOGON_NT_VERSION_5EX for now */
>      if (!(ntver & NETLOGON_NT_VERSION_5EX)) {
>          ret = EINVAL;
> -- 
> 1.7.7.4
> 


-- 
/ Alexander Bokovoy




More information about the Freeipa-devel mailing list