*BSD News Article 97681


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!news.mathworks.com!fu-berlin.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: putpwent() or equivilent?  need to modify password file
Date: 15 Jun 1997 21:31:00 GMT
Organization: Private BSD site, Dresden
Lines: 26
Message-ID: <5o1muk$a6d@uriah.heep.sax.de>
References: <33A1FA9E.3D24AFAC@horizon.no-spmming.net>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:42852

David Morton <mortonda@horizon.no-spmming.net> wrote:

> I need to modify the password (shadow) with a program I'm writing...
> Language: C
> 
> How does one go about doing this?  Thanks for any tips...

Password writing functions are one of the most diverging topics in the
unix world.  I've once collected the data, and hold a paper at a local
(monthly) unix workshop.  You can hardly find two unix systems with
exactly the same semantics and defaults, even despite of SVID
standardizing putpwent(3).  (SVID doesn't standardize handling of the
shadowed file if any exists, AFAIK.)

So, call the appropriate external programs.  For FreeBSD 2.2+, use
pw(8).  David Nugent specifically wrote this program as a backend
workhorse for frontents that want to handle the password and/or group
file.  sysinstall's revamped user/group setup is only the first
incarnation of a frontend.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)