Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I lock the passwd file?

3 views
Skip to first unread message

Russell J Fulton;ccc032u

unread,
Jan 8, 1991, 7:30:46 PM1/8/91
to
I am writing a set of scripts in perl to create and delete users on our
SGI 4D system running Irix 3.3.1.

These scripts (obviously) need to modify the password file /etc/passwd. The
way our system will operate it is quite possible (likely ??) that two or more
people may attempt modification at the same time with erroneous results.

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.

Can anybody tell me how passwd uses this file so I can make my scripts
compatible with it. We also need an edit-passwd script which locks the
passwd file before invoking the editor.

Cheers Russell

--
Russell Fulton, Computer Center, University of Auckland, New Zealand.
<rj_f...@aukuni.ac.nz>

Neil Rickert

unread,
Jan 8, 1991, 8:13:52 PM1/8/91
to
In article <1991Jan9.0...@ccu1.aukuni.ac.nz> rus...@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 <ric...@cs.niu.edu>
Northern Illinois Univ.
DeKalb, IL 60115 +1-815-753-6940

KP KP

unread,
Aug 1, 2022, 6:37:35 PM8/1/22
to
You maar the mut all over it.
0 new messages