All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: Wilson Snyder <wsnyder@wsnyder.org>
Cc: autofs@linux.kernel.org
Subject: Re: HOST expansion with autofs+LDAP
Date: Thu, 21 May 2009 22:38:19 +0800	[thread overview]
Message-ID: <4A15675B.5090307@themaw.net> (raw)
In-Reply-To: <20090521140333.A048214477@wsnyder.org>

Wilson Snyder wrote:
>> Ian Kent wrote:
>>> Wilson Snyder wrote:
>>>> I have a suse10.3 system which includes autofs-5.0.2-30.2
>>>>
>>>> I'd like an LDAP entry that makes an autofs mountpoint that
>>>> includes the local host's name.  If this wasn't under LDAP I
>>>> believe "/net/$HOST" would work - creating a
>>>> "/net/{name-of-hostname}" mountpoint.
>>>>
>>>> However, if I add a mountpoint with cn=$HOST
>>>>
>>>> cn=$HOST,nismapname=auto.net,dc=company,dc=com
>>>>
>>>> The automounter nicely makes a "/net/$HOST" mount -
>>>> *literally* /net/$HOST, that is it doesn't expand $HOST to
>>>> the hostname.
>>>>
>>>> Same thing if I use cn=${host}
>>>>
>>>> Any hints?  Thanks! 
>>> Oddly enough I think that $HOST should be expanded but I have no idea
>>> how you think this is supposed to work because you haven't provided any
>>> information about the LDAP entry, other than the dn, or provided any
>>> debug log information.
>> Sorry, that isn't correct.
>> Macro expansion is not done on keys and never has been.
>>
>> Which begs the question, is it sensible to do macro expansion on keys
>>from a map before trying to match them against the key string received
>>from the kernel for the lookup?
> 
> I'm not sure if I'm decoding the question properly, but I
> suspect it's fast enough to expand on the fly, as that's
> more flexible, but either way works for my application since
> HOST is (well is generally) constant.

Your not interpreting my statement quite right.
The "between the lines" meaning is "question to self; should I allow
this, if not why not"!

Anyway, I haven't got time to ponder that just yet, except for below.

> 
> Can you point me to the right place in t the 5.0.2 sources
> to patch this in? I see the expansion code in parse_mount
> but am not sure what the best place to call it from is.

Mmmm ... it's the "key" so one reason why you might find it difficult is
that you need to "lookup" the string you get from the kernel as a key in
the map source, for example NIS or LDAP, but you can't look it up if the
key in the map source needs to be translated in order to match. Catch 22.

There is just no way that we will do a linear search for every lookup.
Consider what that would mean to someone with a map of more that 6 or 8
thousand entries.

Things start to get more complicated from here on with regard to this
question.

Ian

  reply	other threads:[~2009-05-21 14:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-12 15:45 HOST expansion with autofs+LDAP Wilson Snyder
2009-05-13  4:25 ` Ian Kent
2009-05-13  5:17   ` Ian Kent
2009-05-21 14:03     ` Wilson Snyder
2009-05-21 14:38       ` Ian Kent [this message]
2009-05-22 13:50       ` Jeff Moyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A15675B.5090307@themaw.net \
    --to=raven@themaw.net \
    --cc=autofs@linux.kernel.org \
    --cc=wsnyder@wsnyder.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.