Bug 21517 - Autofs does not work with nisplus
Summary: Autofs does not work with nisplus
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: autofs
Version: 6.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-30 15:56 UTC by Need Real Name
Modified: 2007-04-18 16:30 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-12-07 14:36:10 UTC
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2000-11-30 15:56:48 UTC
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.

Comment 1 Need Real Name 2000-12-07 14:36:07 UTC
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.

Comment 2 Need Real Name 2001-02-08 13:40:25 UTC
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.