*BSD News Article 79469


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!spool.mu.edu!uwm.edu!cs.utexas.edu!howland.erols.net!newsfeed.internetmci.com!in3.uu.net!news.magicnet.net!magicnet.magicnet.net!steven
From: steven@magicnet.net (Steven Bradley)
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: BSDI master.passwd problem
Date: 29 Sep 1996 02:59:36 GMT
Organization: MagicNet, Inc.
Lines: 39
Message-ID: <52komo$1li@comet3.magicnet.net>
NNTP-Posting-Host: magicnet.magicnet.net
X-Newsreader: TIN [version 1.2 PL2]

I have a project which requires the following to be accomplished:

System has normal shell accounts and PPP accounts.  Goal was to rename
passwd to opasswd, create perl script called ppp_passwd, create bourne
script to call opasswd followed by ppp_passwd and the script would be
called passwd (a replacement for system version now called opasswd).

Perl script would find shell passwd, replace PPP passwd field, write
entry back.

I can do everything except for two problems:

(1)  I can not call chpass from the SUID perl script with the -a option
     as it will not allow it.  All the perl script does is finds the
     current login name, takes it's password from master.passwd, finds
     any associated PPP account, and replaces passwd with shell version.
     If the SUID perl script were to run as root when it ran chpass and
     chpass worked as it was supposed to (complains about euid and uid
     can not be swapped), this would have worked perfectly.

(2)  Plan B:  Re-write the master.passwd file with new password.  This
     sounds simple.  It isn't.  I have not been able to find and replicate
     the method of passwd file locking used by the system, for example, as
     it is done in vipw.  I do not know if it uses a "lock file" and if so
     where it places it.  No lock file means a risk of file corruption if
     two different approaches are taken on the same file.

If anyone knows how vipw tells the system that master.passwd is being
changed or any idea on how to accomplish the above section, I would
appreciate it either here or in e-mail.

Thank you,
Steven Bradley
Information Services
Southern Adventist University
E-mail: sbradley@southern.edu or steven@magicnet.net
--
Steven Bradley                 121 Cambridge Drive, Longwood, FL  32779-5707
steven@magicnet.net                   Home: (407) 862-7226 or (407) 869-4598