Subject: RE: More Problems

From: "Churchyard, Peter" <[email-masked]>
Date: Wed, 14 Feb 2001 14:02:34 -0800

[To be removed from this list send the message "unsubscribe fwtk-users" in the
BODY of a mail message to [email-masked].]

You should replace the crypt call with any hash function of your choice. Do
a man crypt and see what library it is in?

Peter.

 > -----Original Message-----
 > From: Sherif Yusuf [mailto:[email-masked]]
 > Sent: Wednesday, February 14, 2001 12:07 PM
 > To: [email-masked]; [email-masked]
 > Subject: More Problems
 > 
 > 
 > Dear All,
 > 
 > It's me again, Sherif Yusuf.  I managed to solve, with your help, the
 > problem of ndbm.h not existing.
 > Now I am faced with another problem which is:
 > 
 > make[1]: Entering directory
 > `/homes/sy99/Research/Ponder/AlomainyProj/fwtk/auth'
 > cc -g -static -o authsrv authsrv.o proto.o db.o pass.o srvio.o
 > ../libauth.a ../libfwall.a    -lgdbm
 > pass.o: In function `passverify':
 > /homes/sy99/Research/Ponder/AlomainyProj/fwtk/auth/pass.c:39: 
 > undefined
 > reference to `crypt'
 > pass.o: In function `passset':
 > /homes/sy99/Research/Ponder/AlomainyProj/fwtk/auth/pass.c:70: 
 > undefined
 > reference to `crypt'
 > collect2: ld returned 1 exit status
 > make[1]: *** [authsrv] Error 1
 > make[1]: Leaving directory
 > `/homes/sy99/Research/Ponder/AlomainyProj/fwtk/auth'
 > 
 > Why is this so?!!!
 > 
 > This is the file that consists the two programs:
 > 
 >  * Copyright (c) 1993, Trusted Information Systems, Incorporated
 >  * All rights reserved.
 >  *
 >  * Redistribution and use are governed by the terms detailed in the
 >  * license document ("LICENSE") included with the toolkit.
 >  */
 > 
 > /*
 >  *      Author: Marcus J. Ranum, Trusted Information Systems, Inc.
 >  */
 > static  char    RcsId[] = "$Header:
 > /usr/home/rick/fwtk2.0/fwtk/auth/RCS/pass.c,v 1.2 1997/01/14 20:20:03
 > rick Exp $";
 > #include        <time.h>
 > #include        "firewall.h"
 > #include        "auth.h"
 > 
 > #ifdef  AUTHPROTO_PASSWORD
 > 
 > extern  char    *crypt();
 > 
 > passverify(user,pass,ap,rbuf)
 > char    *user;
 > char    *pass;
 > Auth    *ap;
 > char    *rbuf;
 > {
 >         char    lclpass[10];
 > 
 >         if(ap->pw[0] == '\0') {
 >                 strcpy(rbuf,"ok");
 >                 return(0);
 >         }
 > 
 >         if(pass == (char *)0)
 >                 goto reject;
 >         strncpy(lclpass, pass, 8);
 >         lclpass[8] = '\0';
 > 
 >         if(!strcmp(crypt(lclpass,ap->pw),ap->pw)) {
 >                 strcpy(rbuf,"ok");
 >                 return(0);
 >         }
 > reject:
 >         strcpy(rbuf,"Permission Denied.");
 >         return(1);
 > }
 > 
 > 
 > static unsigned char itoa64[] =         /* 0 ... 63 => ascii - 64 */
 > 
 > "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
 > 
 > passset(user,pass,ap,rbuf)
 > char    *user;
 > char    *pass;
 > Auth    *ap;
 > char    *rbuf;
 > {
 >         if(pass == (char *)0)
 >                 ap->pw[0] = '\0';
 >         else {
 >                 time_t  t;
 >                 char    salt[2];
 > 
 >                 time(&t);
 >                 salt[0] = itoa64[getpid() & 0x3f];
 >                 salt[1] = itoa64[(int)t & 0x3f];
 >                 if(strlen(pass) > 7)
 >                         pass[8] = '\0';
 >                 strncpy(ap->pw,crypt(pass,salt),AUTH_PWSIZ);
 >         }
 >         if(auth_dbputu(user,ap) == 0)
 >                 sprintf(rbuf,"Password for %s changed.",user);
 >         else
 >                 strcpy(rbuf,"Database error.");
 >         return(0);
 > }
 > #endif
 > 
 > 
 > 
 > 
 > Please help
 > 
 > Thanks
 > Sherif
 > [email-masked]
 >