Hi Ian,

tried to get your patch working. Using CentOS5 which comes with
autofs5.0.1-0.rc2-43... i needed to upgrade to 5.0.2. though. did this
from http://www.kernel.org/pub/linux/daemons/autofs/v5/, patching all
patches for 5.0.2 as described in patch order, then applied the patch u
sent me....

AND

it works!

thx a lot. Do you think this patch or something similar will make it
into mainline?

*nail

Ian Kent wrote:
> On Thu, 2007-07-26 at 15:56 +0200, [EMAIL PROTECTED] wrote:
>>>> Actually this is an LDAP mixed environment with solaris and linux. The
>>>> Solaris Automounter will look for %Java by default to ignore
>>>> case-sensitivity. Is there an option on autofs5 to take the first entry
>>>> for a key in case there are duplicate entries? if so, how is it done? i
>>>> am
>>>> seriously in need of some kind of workaround. is there any possibility?
> 
> Can you point me to any official documentation that describes exactly
> how this % hack is supposed to work?
> 
>>> There isn't .
>>> This would conflict with the work that was done to reduce the number of
>>> queries to LDAP servers.
>>>
>>> I wasn't aware of the Solaris % function.
>>> I'll check when I get some time.
>>>
>>> I could try and make a one-off patch to just use the first entry as a
>>> work around for you till we work out what to do about the % thingy.
> 
> Could you try this patch for the work around please.
> Ian
> 
> ---
> --- autofs-5.0.2/modules/lookup_ldap.c.ignore-duplicates      2007-07-27 
> 11:33:59.000000000 +0800
> +++ autofs-5.0.2/modules/lookup_ldap.c        2007-07-27 11:53:45.000000000 
> +0800
> @@ -1238,7 +1238,15 @@ static int read_one_map(struct autofs_po
>                       /* Check for the "/" and "*" and use as "/" if found */
>                       for (i = 0; i < count; i++) {
>                               /* check for wildcard */
> -                             if (bvKey[i]->bv_len != 1)
> +                             if (bvKey[i]->bv_len > 1) {
> +                                     /* Sun % hack workaround */
> +                                     if (*bvKey[i]->bv_val == '%') {
> +                                             k_val = bvKey[0]->bv_val;
> +                                             k_len = bvKey[0]->bv_len;
> +                                             break;
> +                                     }
> +                                     continue;
> +                             } else if (bvKey[i]->bv_len != 1)
>                                       continue;
>                               if (*bvKey[i]->bv_val != '/' &&
>                                   *bvKey[i]->bv_val != '*')
> @@ -1521,7 +1529,15 @@ static int lookup_one(struct autofs_poin
>                       /* Check for the "/" and "*" and use as "/" if found */
>                       for (i = 0; i < count; i++) {
>                               /* check for wildcard */
> -                             if (bvKey[i]->bv_len != 1)
> +                             if (bvKey[i]->bv_len > 1) {
> +                                     /* Sun % hack workaround */
> +                                     if (*bvKey[i]->bv_val == '%') {
> +                                             k_val = bvKey[0]->bv_val;
> +                                             k_len = bvKey[0]->bv_len;
> +                                             break;
> +                                     }
> +                                     continue;
> +                             } else if (bvKey[i]->bv_len != 1)
>                                       continue;
>                               if (*bvKey[i]->bv_val != '/' &&
>                                   *bvKey[i]->bv_val != '*')
> 

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to