Xref: utzoo comp.unix.internals:1782 comp.sys.sgi:7634 Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool2.mu.edu!uwm.edu!ux1.cso.uiuc.edu!mp.cs.niu.edu!rickert From: rickert@mp.cs.niu.edu (Neil Rickert) Newsgroups: comp.unix.internals,comp.sys.sgi Subject: Re: How do I lock the passwd file? Message-ID: <1991Jan9.011352.21136@mp.cs.niu.edu> Date: 9 Jan 91 01:13:52 GMT References: <1991Jan9.003046.12975@ccu1.aukuni.ac.nz> Distribution: comp Organization: Northern Illinois University Lines: 19 In article <1991Jan9.003046.12975@ccu1.aukuni.ac.nz> russell@ccu1.aukuni.ac.nz (Russell J Fulton;ccc032u) writes: >I am writing a set of scripts in perl to create and delete users on our >SGI 4D system running Irix 3.3.1. > >The man page for passwd(4) suggests that adequate locking MUST be performed >but gives no hint of how. There is a file /etc/.pwd.lock which is presumably >used by the passwd command. > If you have 'vipw', it handles locking for you. Define the EDITOR environment variable to be the editor (or perl or shell or whatever) which will actually do the editing, then invoke 'vipw'. If you can use this, it should be relatively robust in the sense that you won't have to modify your code every time your vendor changes his approach to locking. -- =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= Neil W. Rickert, Computer Science Northern Illinois Univ. DeKalb, IL 60115 +1-815-753-6940