From owner-freebsd-questions Fri May 31 17:08:34 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA24984 for questions-outgoing; Fri, 31 May 1996 17:08:34 -0700 (PDT) Received: from gatekeeper.fsl.noaa.gov (gatekeeper.fsl.noaa.gov [137.75.131.181]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA24974 for ; Fri, 31 May 1996 17:08:32 -0700 (PDT) Received: from emu.fsl.noaa.gov (kelly@emu.fsl.noaa.gov [137.75.60.32]) by gatekeeper.fsl.noaa.gov (8.7.5/8.7.3) with ESMTP id AAA24931; Sat, 1 Jun 1996 00:08:25 GMT Message-Id: <199606010008.AAA24931@gatekeeper.fsl.noaa.gov> Received: by emu.fsl.noaa.gov (1.40.112.3/16.2) id AA114607704; Fri, 31 May 1996 18:08:24 -0600 Date: Fri, 31 May 1996 18:08:24 -0600 From: Sean Kelly To: ims@bcgrizzly.com Cc: questions@freebsd.org In-Reply-To: <199606010001.RAA21750@kodiak.bcgrizzly.com> (message from Ed Imhoff on Fri, 31 May 96 19:49:49 -700) Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >>>>> "Ed" == Ed Imhoff writes: Ed> Hello :) I'm trying to code some HTML to allow a user to login Ed> via WWW interface. How do I create a form that authenticates Ed> a user??? In C, look up the user's password entry with getpwent(3), then get the password salt from the pw_passwd field and pass that along with the typed password to crypt(3). Compare the result to the pw_passwd field with strcmp(3). If it's identical, authenticate. If not, punt 'em out. The perl solution is similar and is left as an exercise. :-) See /usr/src/usr.bin/login/login.c for sample code. -- Sean Kelly NOAA Forecast Systems Laboratory kelly@fsl.noaa.gov Boulder Colorado USA http://www-sdd.fsl.noaa.gov/~kelly/