home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.misc
- Path: sparky!uunet!ukma!wupost!sdd.hp.com!cs.utexas.edu!torn!csd.unb.ca!jaf
- From: jaf@jupiter.sun.csd.unb.ca (J Anthony Fitzgerald)
- Subject: Re: yp (nis) map changes - how do they happen
- Message-ID: <1992Aug30.131151.13011@jupiter.sun.csd.unb.ca>
- Keywords: passwd yp nis
- Organization: University of New Brunswick
- References: <1992Aug27.180340.729@ilinx.wimsey.bc.ca> <janet.714981984@dunnart>
- Date: Sun, 30 Aug 1992 13:11:51 GMT
- Lines: 34
-
- In article <janet.714981984@dunnart> janet@cs.uwa.oz.au (Janet Jackson) writes:
- >There is a daemon, yppasswdd(8) (at least, it's called that on SunOS4.1.1)
- >which passwd(1) talks to. This daemon does the updating. It runs on the
- >YP master.
-
- This brings up another question for me. What locking mechanism (if any) does
- yppasswdd use for the password file. It apparently does not use the same as
- vipw which uses the creation of a link for locking. The man page for yppasswdd
- (at least on my system SunOS 4.1.2) does not explicitly state whether the
- daemon locks the file, however, one note states that the name of the password
- file passed to the daemon must not be a link. Would this restriction be because
- the daemon uses flock(2) to lock access to the file? If so, is flock only
- issued around the actual updates?
-
- The reason I ask is because I have written a script for our account
- administrator to simplify adding/removing users. He obtains a list of
- courses and students generated from the registrar's data bases on the MVS
- system and the script uses this list to add several hundred users at the
- start of each term and remove them at the end.
-
- 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.
-
- I thank you for reading this far.
- --
- J. Anthony Fitzgerald jaf@UNB.ca (506) 453-4573
- Computing Services UofNB Box 4400 (506) 453-3590 (FAX)
- Fredericton, NB, CANADA, E3B 5A3
-