From owner-freebsd-questions Fri May 31 17:32:06 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA26498 for questions-outgoing; Fri, 31 May 1996 17:32:06 -0700 (PDT) Received: from kodiak.bcgrizzly.com (bcgrizzly.com [207.34.136.10]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id RAA26458 for ; Fri, 31 May 1996 17:32:00 -0700 (PDT) Received: from lpm025.bcgrizzly.com (lpm028.bcgrizzly.com [207.34.136.28]) by kodiak.bcgrizzly.com (8.6.11/8.6.9) with SMTP id RAA21923; Fri, 31 May 1996 17:42:40 -0700 Date: Fri, 31 May 1996 17:42:40 -0700 Message-Id: <199606010042.RAA21923@kodiak.bcgrizzly.com> X-Sender: ims@bcgrizzly.com X-Mailer: Windows Eudora Version 1.4.4 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: kelly@fsl.noaa.gov From: ims@bcgrizzly.com (Ed Imhoff) Subject: Re: Forwarded mail.... Cc: questions@freebsd.org Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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. Can you give me an example of how I'd do this? I'm a student learning how to code HTML. The project is to create a form that checks if a user is valid. It then returns output from a script that details his time used online. Right now I'm only interested in getting the HTML coded, and I need to find a way to authenticate the user. > >The perl solution is similar and is left as an exercise. :-) PERL script would prolly work for me better as well.> >See /usr/src/usr.bin/login/login.c for sample code. This didn't help me much, I'm not a C guy :(