[comp.sys.sun] Bug in rpc.yppasswdd ?

djc@kesa.com (Don Christensen) (06/05/91)

I am having a problem getting rpc.yppasswdd to automatically do a yp make
whenever an NIS passwd gets changed.  I am using the exact line given in
the SunOS 4.1.1 System and Network Administration Manual on page 490
(except I am using /etc/passwd as the master passwd file) as follows:

    /usr/etc/yp/rpc.yppasswd /etc/passwd -m passwd DIR=/var/yp/kesa

When I use yppasswd from an NIS client, the maps do not get propogated
until a cron job runs and does it or I do a make by hand.  In trying to
debug this, I replaced /bin/make with a shell script that echoed its
arguments to a file as follows:

    #! /bin/sh
    echo Make arguments are $* > /var/tmp/make.args

After doing a yppasswd on a client, the /var/tmp/make.args file contained
the following:

    Make arguments are /usr/etc/yp/rpc.yppasswd \
    /etc/passwd -m passwd DIR=/var/yp/kesa

    (line broken by me for readability)

It seems to me that this is incorrect ;^)  Am I doing something wrong?
Is there a workaround or patch that I do not know about?  We are running
4.1.1 with no patches on an IPC.

Thanks for any help.

-Don
-- 
Don Christensen  <=> djc@kesa.com     <=> "Ashes and diamonds, foe and friend;
Kesa Corporation <=> ...!mips!kesa!djc <=> they are all equal in the end."
Santa Clara, CA  <=> ...!daver!kesa!djc <=>                      -- Pink Floyd

rossc@extro.ucc.su.oz.au (Ross Cartlidge) (06/05/91)

djc@kesa.com (Don Christensen) writes:

>I am having a problem getting rpc.yppasswdd to automatically do a yp make
>whenever an NIS passwd gets changed.  I am using the exact line given in
>the SunOS 4.1.1 System and Network Administration Manual on page 490
>(except I am using /etc/passwd as the master passwd file) as follows:

>    /usr/etc/yp/rpc.yppasswd /etc/passwd -m passwd DIR=/var/yp/kesa


	Take out the DIR=/var/yp/kesa and it'll work fine.
	Go to to /var/yp and type:-

	make passwd DIR=/var/yp/kesa

	and you'll see it fails.

-- 
________________________________________________________________________
Ross Rodney Cartlidge			    |   rossc@extro.ucc.su.oz.au
University Computing Service, H08	    |   Phone:     +61 2 6923497
University of Sydney, NSW 2006, Australia   |   FAX:       +61 2 6606557

jba@gorm.ruc.dk (Jan B. Andersen) (06/13/91)

djc@kesa.com (Don Christensen) writes:

>I am having a problem getting rpc.yppasswdd to automatically do a yp make
>whenever an NIS passwd gets changed.  I am using the exact line [...]
>
>    /usr/etc/yp/rpc.yppasswd /etc/passwd -m passwd DIR=/var/yp/kesa
>
> [...] I replaced /bin/make with a shell script that echoed its
> arguments to a file as follows:
>
>    #! /bin/sh
>    echo Make arguments are $* > /var/tmp/make.args
>
>After doing a yppasswd on a client, the /var/tmp/make.args file contained
>the following:
>
>    Make arguments are /usr/etc/yp/rpc.yppasswd \
>    /etc/passwd -m passwd DIR=/var/yp/kesa
>
>    (line broken by me for readability)
>
>It seems to me that this is incorrect ;^)  Am I doing something wrong?

To which rossc@extro.ucc.su.oz.au (Ross Cartlidge) replies:

>Take out the DIR=/var/yp/kesa and it'll work fine.

No - It won't work!! The problem is that rpc.yppasswdd generates the wrong
set of arguments to make instead of using the -m value.

I had the same problem until 10 min. ago (and thus had to run a cron-job
every 10 min to update the maps), but inspired by your test I came up with
the following fix:

In /var/yp/Makefile, insert a target that matches whatever rpc.yppasswd
generates and let that target do a 'make passwd' instead. On my system
(with "rpc.yppasswdd /usr/etc/NIS-Master-files/passwd -m passwd" in
/etc/rc.local) it becomes:

 rpc.yppasswdd:
   @echo "This is a gigantic fix for rpc.yppasswdd"
   @echo "Why does it call make with the arguments"
   @echo "rpc.yppasswdd /usr/etc/NIS-Master-files/passwd -m passwd"
   @echo "when 'passwd' would do nicely?"
   @echo "Go and simulate it"
   $(MAKE) $(MFLAGS) passwd
   exit 0

      /|  / Jan B. Andersen                        /^^^\     .----------------.
     / | /  RUC, Hus 19,1     jba@dat.ruc.dk      { o_o }    | SIMULA does it |
    /--|/   Postbox 260       DG-passer@ruc.dk     \ o / --> | with CLASS     |
`--'   '    DK-4000 Roskilde  Postmaster@ruc.dk --mm---mm--  `----------------'