home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.misc:3528 comp.sys.sun.admin:6169
- Newsgroups: comp.unix.misc,comp.sys.sun.admin
- Path: sparky!uunet!decwrl!access.usask.ca!ccu.umanitoba.ca!mills
- From: mills@ccu.umanitoba.ca (Gary Mills)
- Subject: Re: yp (nis) map changes - how do they happen
- Message-ID: <1992Sep6.024242.24232@ccu.umanitoba.ca>
- Keywords: passwd yp nis
- Organization: University of Manitoba, Winnipeg, Canada
- References: <1992Aug27.180340.729@ilinx.wimsey.bc.ca> <janet.714981984@dunnart> <1992Aug30.131151.13011@jupiter.sun.csd.unb.ca>
- Date: Sun, 6 Sep 1992 02:42:42 GMT
- Lines: 38
-
- [comp.sys.sun.admin added; hi Tony]
- In <1992Aug30.131151.13011@jupiter.sun.csd.unb.ca> jaf@jupiter.sun.csd.unb.ca (J Anthony Fitzgerald) writes:
-
- >This brings up another question for me. What locking mechanism (if any) does
- >yppasswdd use for the password file.
-
- It uses a lockfile with a name derived by appending ``.ptmp'' to the name
- of your NIS passwd base file. The locking is apparently done around the
- edit of the file, but not around the NIS make.
-
- >I have been concerned because of the possibility of yppasswdd updating the
- >password file between the time the script reads in the password and group
- >files and the rewriting of those files after applying changes. I have been
- >assuming that the yppasswdd changes would be quietly lost. It would be
- >quite simple to add a perl flock call to the script but I would like to be
- >assured that this would fix any potential problem. So far, the scripts seem
- >to have caused no problem, but it might be a simple case of no one ever having
- >used yppasswd while the script was running.
-
- In this case, you might want to just kill and restart yppasswd before and
- after you run the script. You could also have the script create, and
- respect the same lockfile. However, some versions of yppasswdd will exit
- ungracefully if they discover that somebody else has created the lockfile.
-
- There is some danger of corrupting the NIS base file if both yppasswdd and
- your script attempt to update it at the same time. In addition, if two
- users change their password at the same time, both makes running at the
- same time will surely corrupt the NIS password maps. Usually, one of them
- becomes empty. This can also happen if a human or your script does the
- make at the same time as a user changes his password. There is no locking
- in the Makefile to protect against this.
-
- I fixed this under 4.1.2 by finding a version of yppasswdd, from one of
- the 4.1.1 C2 security patches, that waits when the lockfile is present,
- and by adding locking to the Makefile. When I refered the problem to Sun,
- the response was that it's a known bug, and is not fixed.
- --
- -Gary Mills- -Networking Group- -U of M Computer Services-
-