From owner-freebsd-questions@FreeBSD.ORG Wed Jan 21 14:48:20 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 049AC16A4CE for ; Wed, 21 Jan 2004 14:48:20 -0800 (PST) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFDAA43D5A for ; Wed, 21 Jan 2004 14:47:54 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i0LMlnse036791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Jan 2004 22:47:49 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i0LMlnSZ036790; Wed, 21 Jan 2004 22:47:49 GMT (envelope-from matthew) Date: Wed, 21 Jan 2004 22:47:49 +0000 From: Matthew Seaman To: Gabor Esperon Message-ID: <20040121224749.GB36113@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Gabor Esperon , freebsd-questions@freebsd.org References: <20040121223112.38059.qmail@web11502.mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="z6Eq5LdranGa6ru8" Content-Disposition: inline In-Reply-To: <20040121223112.38059.qmail@web11502.mail.yahoo.com> User-Agent: Mutt/1.5.5.1i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.62 X-Spam-Checker-Version: SpamAssassin 2.62 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk 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: Wed, 21 Jan 2004 22:48:20 -0000 --z6Eq5LdranGa6ru8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. 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). Cheers, Matthew --=20 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 --z6Eq5LdranGa6ru8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFADwGVdtESqEQa7a0RAk6WAJsFeMoUnAF+wDfjk7zLISazOssEKQCffFla NmUSVoJHONNwpb3uxuN+JzU= =GLpu -----END PGP SIGNATURE----- --z6Eq5LdranGa6ru8--