From owner-freebsd-questions@FreeBSD.ORG Wed Jan 21 21:35:46 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53FC616A4CE for ; Wed, 21 Jan 2004 21:35:46 -0800 (PST) Received: from web11508.mail.yahoo.com (web11508.mail.yahoo.com [216.136.172.40]) by mx1.FreeBSD.org (Postfix) with SMTP id 4E3A843D31 for ; Wed, 21 Jan 2004 21:35:45 -0800 (PST) (envelope-from gesperon@yahoo.com) Message-ID: <20040122053545.66503.qmail@web11508.mail.yahoo.com> Received: from [200.55.153.13] by web11508.mail.yahoo.com via HTTP; Wed, 21 Jan 2004 21:35:45 PST Date: Wed, 21 Jan 2004 21:35:45 -0800 (PST) From: Gabor Esperon To: Matthew Seaman In-Reply-To: <20040121224749.GB36113@happy-idiot-talk.infracaninophile.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-questions@freebsd.org Subject: Re: Fwd: About *pwent() functions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 05:35:46 -0000 --- Matthew Seaman wrote: > On Wed, Jan 21, 2004 at 02:31:12PM -0800, Gabor > Esperon wrote: > > I need some function to add a user to the system, > > something like the addpwent implemented in pw(8) > user > > and program but freebsd only have functions like: > > There aren't functions to add user accounts via a C > api in the > standard FreeBSD system libraries. There are > various applications > that will do the job for you -- pw(8) is probably > the best choice -- > and it shouldn't be too hard to fork(2) and > execve(2) it > with an appropriate set of command line arguments. I am implementing a PAM module that authenticate and create a user on demand according to some parameters and PAM modules not allow file execution. > Or if you know that you're using the local password > file, then you can > write code that locks master.passwd, appends a line > with the correct > data, unlocks it and runs pwd_mkdb(8). Yes I'm using the local password file. Which APIs should i use to implement pwd_mkdb(8)? > Cheers, > > Matthew > > -- > Dr Matthew J Seaman MA, D.Phil. > 26 The Paddocks > > Savill Way > PGP: http://www.infracaninophile.co.uk/pgpkey > Marlow > Tel: +44 1628 476614 > Bucks., SL7 1TH UK > > ATTACHMENT part 2 application/pgp-signature ===== Gabor Net/Sys Admin __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/