I can't get autofs working with nisplus. /etc/auto.master looks like this: ----- /users nisplus:auto_users.org_dir -nosuid,hard,intr,noquota ----- The output of `niscat auto_users.org_dir` is as follows: ----- a alpha:/export/users/a b beta:/export/users/b c gamma:/export/users/c z sync:/export/users/z ----- When I try to cd to /users/z, I get the following error in the syslog: ----- Nov 30 14:09:26 anno automount[31162]: attempting to mount entry /users/z Nov 30 14:09:26 anno automount[31299]: lookup(nisplus): lookup for z failed: Not found ----- I have traced the problem down to the file modules/lookup_nisplus.c. sprintf(tablename, "[key=%s],%s.org_dir.%s", name, ctxt->mapname, ctxt->domainname); result = nis_list(tablename, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL); nis_list returns 29: NIS_BADATTRIBUTE. When I change that into sprintf(tablename, "%s.org_dir.%s, ctxt->mapname, ctxt->domainname); and ommit the ".org_dir" in /etc/auto.master, I get an successfull look_up, but a wrong mount. alpha:/export/users/a will be mounted on /users/z, instead of sync:/users/z. In fact, the above nis_list statement returns the content of the entire nisplus map, and only the first entry is used. Obviously the "[key=%s]", name is needed, but the syntax appears to be wrong. Same in autofs-3.1.6.
The key in sprintf(tablename, "[key=%s],%s.org_dir.%s", name, ctxt->mapname, ctxt->domainname); actually is wrong. According to the sources of nismatch by Thorsten Kukuk, this has to be changed to mountpoint sprintf(tablename, "[mountpoint=%s],%s.org_dir.%s", name, ctxt->mapname, ctxt->domainname); Then, everything works fine.
Okay, I had some nisplus tables wrong and was jumping the gun.