Problem with autofs 3.1.7 -> 4.1.0-beta2
Subsystems (2)
Hello,
I am currently running autofs 3.1.7 from Fedora Core 1. I am trying to upgrade to 4.1.0-beta2 from atrpms.
I recently switched to using ldap. I admit I dont understand it the way I do NIS..but anyway. Here is what my "map" looks like:
auto.services:
/ fileserver:/export/services/& a fileserver:/export2/a b fileserver:/export2/b c fileserver:/export2/c d fileserver:/export2/d
This works fine under 3.1.7. With 4.1.0, cd'ing into /services/<anything> results in /export2/b getting mounted. I can't understand this at all.
Any thoughts on how to fix this or debug the problem?
Michael
Ian Kent
maintainerSounds like a bug. I'll investigate.
Quoted 8 lines · Michael Blandford
Hello,
I am currently running autofs 3.1.7 from Fedora Core 1. I am trying to upgrade to 4.1.0-beta2 from atrpms.
I recently switched to using ldap. I admit I dont understand it the way I do NIS..but anyway. Here is what my "map" looks like:
Quoted 6 lines
auto.services:
/ fileserver:/export/services/& a fileserver:/export2/a b fileserver:/export2/b c fileserver:/export2/c d fileserver:/export2/d
This looks like a NIS map. Shouldn't the / be a * in this case and shouldn't the wildcard map entry come last. I thouht that the defined behaviour of the wildcard map entry was that once it is encountered map processing stops.
Quoted 4 lines
This works fine under 3.1.7. With 4.1.0, cd'ing into /services/<anything> results in /export2/b getting mounted. I can't understand this at all.
It might be something to with the multi-mount code getting confused.
Signature · 4 lines
,-._|\ Ian Kent / \ Perth, Western Australia *_.--._/ E-mail: [email protected] v Web: http://themaw.net/
Quoted 5 lines
This looks like a NIS map. Shouldn't the / be a * in this case and shouldn't the wildcard map entry come last. I thouht that the defined behaviour of the wildcard map entry was that once it is encountered map processing stops.
Yes, I didnt know how to represent what was in ldap very well so I made it look like it did in NIS.
If there is a good way to do an ldapsearch to show the exact config, please show me the syntax and I would be happy to report that back.
According to the automount man page, the wildcard for ldap is a / so that is what I was using. What I thought was odd was it was always choosing the same thing and it *wasn't* the wildcard.
I didnt think there was ordering per say in the nis or ldap maps.
If my config is wrong, or if I cant do wildcards in this way, that is fine. I just know it works differently between 3.1.7 and 4.1.0.
Michael
Quoted 3 lines · Ian Kent
This looks like a NIS map. Shouldn't the / be a * in this case and shouldn't the wildcard map entry come last. I thouht that the defined behaviour of the wildcard map entry was that once it is encountered map processing stops.
Nope... especially not for non-file maps where there really is no such thing as "order"...
-hpa
Ian Kent
maintainerQuoted 3 lines · Michael Blandford
If there is a good way to do an ldapsearch to show the exact config, please show me the syntax and I would be happy to report that back.
Which schema are you using the nisMap or automountMap.
I'll need an ldif example in order to duplicate the problem.
You should be able to do an ldapsearch -x and get the entire database. As long as your /etc/openldap/ldap.conf specifies the BASE and HOST entries.
Quoted 4 lines
According to the automount man page, the wildcard for ldap is a / so that is what I was using. What I thought was odd was it was always choosing the same thing and it *wasn't* the wildcard.
Think the code is incorrect.
Quoted 2 lines
I didnt think there was ordering per say in the nis or ldap maps.
Yep. As Peter says my understanding is not right.
Quoted 3 lines
If my config is wrong, or if I cant do wildcards in this way, that is fine. I just know it works differently between 3.1.7 and 4.1.0.
That's no good.
Wherever possible and relevant v3 and v4 should provide the same behavior for any given configuration.
Signature · 4 lines
,-._|\ Ian Kent / \ Perth, Western Australia *_.--._/ E-mail: [email protected] v Web: http://themaw.net/
Quoted 4 lines · Ian Kent
Which schema are you using the nisMap or automountMap.
automountMap
Quoted 4 lines
I'll need an ldif example in order to duplicate the problem.
Names are changed to protect the innocent.
# auto.master, kmaclub, com
dn: ou=auto.master,dc=kmaclub,dc=com
objectClass: top
objectClass: automountMap
ou: auto.master
# /services, auto.master, kmaclub, com
dn: cn=/services, ou=auto.master,dc=kmaclub,dc=com
objectClass: automount
automountInformation: ldap:ou=auto.services,dc=kmaclub,dc=com
cn: /services
# auto.services, kmaclub, com
dn: ou=auto.services,dc=kmaclub,dc=com
objectClass: top
objectClass: automountMap
ou: auto.services
# /, auto.services, kmaclub, com
dn: cn=/,ou=auto.services,dc=kmaclub,dc=com
objectClass: automount
automountInformation: fileserver:/export/services/&
cn: /
# mounta, auto.services, kmaclub, com
dn: cn=mounta,ou=auto.services,dc=kmaclub,dc=com
objectClass: automount
cn: mounta
automountInformation: fileserver:/export2/mounta
# mountb, auto.services, kmaclub, com
dn: cn=mountb,ou=auto.services,dc=kmaclub,dc=com
objectClass: automount
cn: mountb
automountInformation: fileserver:/export2/mountb
# mountc, auto.services, kmaclub, com
dn: cn=mountc,ou=auto.services,dc=kmaclub,dc=com
objectClass: automount
cn: mountc
automountInformation: fileserver:/export2/mountc
# mountd, auto.services, kmaclub, com
dn: cn=mountd,ou=auto.services,dc=kmaclub,dc=com
objectClass: automount
cn: mountd
automountInformation: fileserver:/export2/mountd
~
Quoted 8 lines
Quoted 3 lines
According to the automount man page, the wildcard for ldap is a / so that is what I was using. What I thought was odd was it was always choosing the same thing and it *wasn't* the wildcard.
Think the code is incorrect.
I reloaded autofs-4.1.0-beta2 again today just to play. What I have found is cd'ing into /services/asdlfjadalsdjfaklsdjf will also suceed and give me a mount to fileserver:/export2/mountb even though the mount should fail.
Michael
Ian Kent
maintainerQuoted 15 lines · Michael Blandford
Hello,
I am currently running autofs 3.1.7 from Fedora Core 1. I am trying to upgrade to 4.1.0-beta2 from atrpms.
I recently switched to using ldap. I admit I dont understand it the way I do NIS..but anyway. Here is what my "map" looks like:
auto.services:
/ fileserver:/export/services/& a fileserver:/export2/a b fileserver:/export2/b c fileserver:/export2/c d fileserver:/export2/d
Quoted 5 lines
This works fine under 3.1.7. With 4.1.0, cd'ing into /services/<anything> results in /export2/b getting mounted. I can't understand this at all.
Any thoughts on how to fix this or debug the problem?
Could you try this patch please.
I'll add it to my source rpm at kernel.org if it works OK for you. You will need to grab a src rpm, build it, install the bin, got to the rpm build directory and do make clean, apply the patch, and make then make install. Be aware this will toast youre autofs init script, auto.master and auto.net (if you have changed them.
lib/cache.c +8 -7
@@ -148,11 +148,15 @@int cache_update (const char *key,const char *mapent,time_t age) { -struct mapent_cache *me =NULL ; +struct mapent_cache *s, *me =NULL ;char *pkey, *pent;unsigned int hashval; -if ((me =cache_lookup (key)) ==NULL ) { +for (s = mapent_hash[hash (key)]; s !=NULL ; s = s->next) +if (strcmp (key, s->key) ==0 ) + me = s; + +if (me ==NULL ) { me = (struct mapent_cache *)malloc (sizeof (struct mapent_cache ));if (me ==NULL ) {return 0 ;
@@ -348,14 +352,11 @@"cache_ghost: entry in %s not valid map format, key %s" , gc.mapname, gc.key); }else if (match ==LKP_WILD ) { -/* Wildcard must be last key in map */ if (*me->key =='/' )syslog (LOG_NOTICE ,"cache_ghost: wildcard map key not valid in direct map" ); -else -syslog (LOG_NOTICE , -"cache_ghost: cannot ghost wildcard map key" ); -break ; + me = me->next; +continue ;; }switch (match) {
Signature · 4 lines
,-._|\ Ian Kent / \ Perth, Western Australia *_.--._/ E-mail: [email protected] v Web: http://themaw.net/
Quoted 7 lines · Ian Kent
Could you try this patch please.
I'll add it to my source rpm at kernel.org if it works OK for you.
You will need to grab a src rpm, build it, install the bin, got to the rpm build directory and do make clean, apply the patch, and make then make install. Be aware this will toast youre autofs init script, auto.master and auto.net (if you have changed them.
I used this patch all day and haven't had any problems with it. It seems good to me.
Michael
Ian Kent
maintainerQuoted 13 lines · Michael Blandford
Quoted 10 lines · Ian Kent
Could you try this patch please.
I'll add it to my source rpm at kernel.org if it works OK for you. You will need to grab a src rpm, build it, install the bin, got to the rpm build directory and do make clean, apply the patch, and make then make install. Be aware this will toast youre autofs init script, auto.master and auto.net (if you have changed them.
Quoted 3 lines
I used this patch all day and haven't had any problems with it. It seems good to me.
Thanks, I'll put it with the 4.1.0 tar and add it to the source rpm (that will be a -2) at kernel.org.
Signature · 4 lines
,-._|\ Ian Kent / \ Perth, Western Australia *_.--._/ E-mail: [email protected] v Web: http://themaw.net/