Subject: Re: batch passwd
To: Wojciech Puchar <wojtek@wojtek.3miasto.net>
From: Michael Kukat <michael@unixiron.org>
List: netbsd-users
Date: 08/13/2001 08:50:58
Hi !
On Mon, 13 Aug 2001, Wojciech Puchar wrote:
> what is C-library function name to encrypt password (i will run usermod
> from C program)
Usually, crypt() does this job. But be careful to use it, it will result in
different outputs, depending on the password encoding scheme. The old scheme
gives 13 chars, the newer MD5 thing results in a longer string. Maybe NetBSD
always results in 13 chars, but your code will not be portable, as i saw in
a little program, as soon as it touched FreeBSD :)
Don't forget to link libcrypt in NetBSD and most other Unices, only a small
number of them (like Linux) has this function in libc.
...Michael
--
visit http://www.bsdfans.org/ Home network powered by: NetBSD OpenBSD FreeBSD
Solaris HP-UX IRIX AIX MUNIX Tru64 Ultrix VMS SINIX Dolphin_Unix OpenStep MacOS