Bug 21517 - Autofs does not work with nisplus
Autofs does not work with nisplus
Product: Red Hat Linux
Classification: Retired
Component: autofs (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2000-11-30 10:56 EST by Need Real Name
Modified: 2007-04-18 12:30 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-12-07 09:36:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2000-11-30 10:56:48 EST
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

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,
        result =
            nis_list(tablename, FOLLOW_PATH | FOLLOW_LINKS, 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

Same in autofs-3.1.6.
Comment 1 Need Real Name 2000-12-07 09:36:07 EST
The key in 

        sprintf(tablename, "[key=%s],%s.org_dir.%s", name, ctxt->mapname,

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,

Then, everything works fine.
Comment 2 Need Real Name 2001-02-08 08:40:25 EST
Okay, I had some nisplus tables wrong and was jumping the gun.

Note You need to log in before you can comment on or make changes to this bug.