AW: getpwnam with md5 encrypted passwds

From: Kai Mosebach (kai_at_freshx.de)
Date: 11/26/03

  • Next message: non_at_ever.sanda.gr.jp: "Re: puc/sio driver - receives but doesn't send"
    To: "'Terry Lambert'" <tlambert2@mindspring.com>
    Date: Wed, 26 Nov 2003 14:21:04 +0100
    
    

    > -----Ursprüngliche Nachricht-----
    > Von: Terry Lambert [mailto:tlambert2@mindspring.com]
    > Gesendet: Mittwoch, 26. November 2003 13:34
    > An: sapdb@komadev.de
    > Cc: freebsd-hackers@freebsd.org
    > Betreff: Re: getpwnam with md5 encrypted passwds
    >
    > "sapdb@komadev.de" wrote:
    > > i am trying to validate a given user password against my local passwd-
    > file with
    > > this piece of code :
    > >
    > > if (!( pwd = getpwnam ( user ))) {
    > > log(ERROR,"User %s not known",user);
    > > stat=NOUSER;
    > > }
    > > if (!strcmp( crypt(pass,pwd->pw_name), pwd->pw_passwd) ) {
    > > log(DEBUG|MISC,"HURRAY : %s authenticated\n", user);
    > > stat = AUTHED;
    > > }
    >
    > I know you have the fix for the crypt of the wrong field, but the
    > proper thing to do is probably to use pan_authenticate() so that
    > you are insensitive to the athentication method being used, rather
    > than crypting and comparing it yourself.
    >

    Looks interesting ... is this method also usable, when i dropped my privs ?

    cheers

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: non_at_ever.sanda.gr.jp: "Re: puc/sio driver - receives but doesn't send"