From mboxrd@z Thu Jan 1 00:00:00 1970 From: wsnyder@wsnyder.org (Wilson Snyder) Subject: Re: HOST expansion with autofs+LDAP Date: Thu, 21 May 2009 10:03:33 -0400 (EDT) Message-ID: <20090521140333.A048214477@wsnyder.org> References: <20090512154529.9FC3313ED0@wsnyder.org> <4A0A4BCC.4030702@themaw.net> <4A0A57E0.3010601@themaw.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autofs-bounces@linux.kernel.org Errors-To: autofs-bounces@linux.kernel.org To: raven@themaw.net Cc: autofs@linux.kernel.org >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. 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. Thanks -Wilson