Skip to contentSkip to conversation

Using Multiple SEARCH_BASE entries

DISCUSSION Sven Geggus 2 participants 4 messages Feb 7, 2014 – Feb 9, 2014 Kernel automounter

lore
Share & tools
lore
#0 lore raw

Hello,

while migrating my autofs entries to another directory server I also tried to split the entries by organisational units.

For this purpose I put the following in /etc/default/autofs:
SEARCH_BASE="ou=autofs,OU=department1,OU=myplace,OU=mydivision,dc=mycompany,DC=com" SEARCH_BASE="ou=autofs,OU=department2,OU=myplace,OU=mydivision,dc=mycompany,DC=com"

Autofs schema is NIS style because this is the only one which active directory and Samba4 support without too much hassle.

However, the splitting does not seem to work.

It is always using the first entry only:

...
get_query_dn: lookup(ldap): found search base under ou=autofs,OU=department1,OU=myplace,OU=mydivision,dc=mycompany,DC=com
get_query_dn: lookup(ldap): found query dn CN=auto.master,OU=autofs,OU=department1,OU=myplace,OU=mydivision,dc=mycompany,DC=com
...

Changing SEARCH_BASE to the following does not help either:
SEARCH_BASE="OU=myplace,OU=mydivision,dc=mycompany,DC=com"

...
get_query_dn: lookup(ldap): found search base under OU=myplace,OU=mydivision,dc=mycompany,DC=com"
get_query_dn: lookup(ldap): found query dn CN=auto.master,OU=autofs,OU=department2,OU=myplace,OU=mydivision,dc=mycompany,DC=com"
...

No idea why it ends up using department2 in the second case.

Any Idea?

Regards

Sven

P.S.: My autofs version is 5.0.7-3 from Debian 7.0

Signature · 4 lines
Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety (Benjamin Franklin)

/me is giggls@ircnet, http://sven.gegg.us/ on the Web
maintainer
#1 lore raw
Quoted 5 lines · Sven Geggus

Hello,

while migrating my autofs entries to another directory server I also tried to split the entries by organisational units.

Quoted 8 lines

For this purpose I put the following in /etc/default/autofs:
SEARCH_BASE="ou=autofs,OU=department1,OU=myplace,OU=mydivision,dc=mycompany,DC=com" SEARCH_BASE="ou=autofs,OU=department2,OU=myplace,OU=mydivision,dc=mycompany,DC=com"

Autofs schema is NIS style because this is the only one which active directory and Samba4 support without too much hassle.

However, the splitting does not seem to work.

I think you'll need to describe the structure of your LDAP entries, how you expect them to be accessed, and how you expect they will be differentiated one for the other.

If you have the same map name in a subtree that is going to be found.

Quoted 11 lines

It is always using the first entry only:

...
get_query_dn: lookup(ldap): found search base under ou=autofs,OU=department1,OU=myplace,OU=mydivision,dc=mycompany,DC=com
get_query_dn: lookup(ldap): found query dn CN=auto.master,OU=autofs,OU=department1,OU=myplace,OU=mydivision,dc=mycompany,DC=com
...

Changing SEARCH_BASE to the following does not help either:
SEARCH_BASE="OU=myplace,OU=mydivision,dc=mycompany,DC=com"

Quoted 6 lines

...
get_query_dn: lookup(ldap): found search base under OU=myplace,OU=mydivision,dc=mycompany,DC=com"
get_query_dn: lookup(ldap): found query dn CN=auto.master,OU=autofs,OU=department2,OU=myplace,OU=mydivision,dc=mycompany,DC=com"
...

No idea why it ends up using department2 in the second case.

No idea, could be a problem with the lookup, can't tell without more information.

Quoted 9 lines

Any Idea?

Regards

Sven

P.S.: My autofs version is 5.0.7-3 from Debian 7.0

maintainer
#3 lore raw
In reply to Sven Geggus
Quoted 9 lines · Sven Geggus

Changing SEARCH_BASE to the following does not help either:
SEARCH_BASE="OU=myplace,OU=mydivision,dc=mycompany,DC=com"

...
get_query_dn: lookup(ldap): found search base under OU=myplace,OU=mydivision,dc=mycompany,DC=com"
get_query_dn: lookup(ldap): found query dn CN=auto.master,OU=autofs,OU=department2,OU=myplace,OU=mydivision,dc=mycompany,DC=com"
...

No idea why it ends up using department2 in the second case.

Yeah, don't know, maybe the list is being traversed backward. That would be easy to change but, if there are multiple possible matches in the subtrees changing that won't help.

Quoted 9 lines

Any Idea?

Regards

Sven

P.S.: My autofs version is 5.0.7-3 from Debian 7.0

No idea what that means.
The Debian maintainer needs to step up to clarify what's included in that package.

Ian

#2 lore raw
In reply to Ian Kent

Ian Kent schrieb am Sonntag, den 09. Februar um 03:27 Uhr:

Quoted 3 lines

I think you'll need to describe the structure of your LDAP entries, how you expect them to be accessed, and how you expect they will be differentiated one for the other.

Hm, would I need a SEARCH_BASE entry for each department or would it be enough to have one with OU=myplace,OU=mydivision,DC=mycompany,DC=com only?

All I want to have is home directory mappings for users from different departments like this:

/home/user1 (from depatment 1) mapped to server1.mycompany.com:/storage/home/user1 /home/user2 (from depatment 1) mapped to server2.mycompany.com:/storage/home/user2

The different subtrees in ldap are for organizational purposes only (writable by admin1, admin2, ..) but should work the same as far as autofs is concerned. This worked fine with both user entries in one hierachy of ldap but currently does not work with if I separate them by OU=department1/OU=department2.

Here is what all my ldap entries (currently only for two test users:
user1 from department1 and user2 from department2) look like:

dn: CN=auto.master,OU=autofs,OU=department1,OU=myplace,OU=mydivision,DC=mycompany,DC=com
objectClass: top
objectClass: nisMap
cn: auto.master
name: auto.master
nisMapName: auto.master

dn: CN=auto.home,OU=autofs,OU=department1,OU=myplace,OU=mydivision,DC=mycompany,DC=com
objectClass: top
objectClass: nisMap
cn: auto.home
name: auto.home
nisMapName: auto.home

dn: CN=auto.master,OU=autofs,OU=department2,OU=myplace,OU=mydivision,DC=mycompany,DC=com
objectClass: top
objectClass: nisMap
cn: auto.master
name: auto.master
nisMapName: auto.master

dn: CN=auto.home,OU=autofs,OU=department2,OU=myplace,OU=mydivision,DC=mycompany,DC=com
objectClass: top
objectClass: nisMap
cn: auto.home
name: auto.home
nisMapName: auto.home

dn: CN=/home,CN=auto.master,OU=autofs,OU=department1,OU=myplace,OU=mydivision,DC=mycompany,DC=com
objectClass: top
objectClass: nisObject
cn: /home
name: /home
nisMapEntry: auto.home
nisMapName: auto.master

dn: CN=user1,CN=auto.home,OU=autofs,OU=department1,OU=myplace,OU=mydivision,DC=mycompany,DC=com
objectClass: top
objectClass: nisObject
cn: user1
name: user1
nisMapEntry: -fstype=nfs4,sec=krb5 server1.mycompany.com:/storage/home/user1
nisMapName: auto.home

dn: CN=/home,CN=auto.master,OU=autofs,OU=department2,OU=myplace,OU=mydivision,DC=mycompany,DC=com
objectClass: top
objectClass: nisObject
cn: /home
name: /home
nisMapEntry: auto.home
nisMapName: auto.master

dn: CN=user2,CN=auto.home,OU=autofs,OU=department2,OU=myplace,OU=mydivision,DC=mycompany,DC=com
objectClass: top
objectClass: nisObject
cn: user2
name: user2
nisMapEntry: -fstype=nfs4,sec=krb5 server2.mycompany.com:/storage/home/user2
nisMapName: auto.home

Quoted 2 lines

No idea, could be a problem with the lookup, can't tell without more information.

What else do you need? More Output from "automount -f -v -d"?

Regards

Sven

P.S.: Regarding the Version. Looks like Debian applied a couple of minor patches to vanilla autofs 5.0.7, but none of them seems to be ldap related.

Signature · 4 lines
"I'm a bastard, and proud of it"
                          (Linus Torvalds, Wednesday Sep 6, 2000)

/me is giggls@ircnet, http://sven.gegg.us/ on the Web