Date: Wed, 21 Jan 2004 22:47:49 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Gabor Esperon <gesperon@yahoo.com> Cc: freebsd-questions@freebsd.org Subject: Re: Fwd: About *pwent() functions Message-ID: <20040121224749.GB36113@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <20040121223112.38059.qmail@web11502.mail.yahoo.com> References: <20040121223112.38059.qmail@web11502.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040121224749.GB36113>