From owner-freebsd-hackers Wed Apr 22 23:22:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA13373 for freebsd-hackers-outgoing; Wed, 22 Apr 1998 23:22:28 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from fedor.ipe.spb.su (ns.ipe.spb.su [195.242.24.253]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA13358 for ; Wed, 22 Apr 1998 23:22:16 -0700 (PDT) (envelope-from dio@ax.ru) Received: from ax.ru ([195.201.17.1]) by fedor.ipe.spb.su (8.8.8/8.8.6) with ESMTP id KAA03779; Thu, 23 Apr 1998 10:25:02 +0400 (MSD) Message-ID: <353EDE46.44FA7934@ax.ru> Date: Thu, 23 Apr 1998 10:23:02 +0400 From: "Denis V. Talonin" X-Mailer: Mozilla 4.02 [en] (Win95; I) MIME-Version: 1.0 To: "Leon Felipe Rodriguez J. -CENCAR" CC: freebsd-hackers@FreeBSD.ORG Subject: Re: Undefined symbol `_crypt' referenced from text segment References: <9804221117.ZM29375@osiris.staff.udg.mx> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Leon Felipe Rodriguez J. -CENCAR wrote: > Hi!!! > > i'm working on web design and I need to create encripted passwors, I tried with > a modified version of NCSA htpasswd program: > > genpass.c > > # more genpass.c > /* > * htpasswd.c: simple program for manipulating password file for NCSA httpd > * > */ > > #include > #include > #include > #include > #include > #include > > #define LF 10 > #define CR 13 > > #define MAX_STRING_LEN 256 > > char *tn; > > /* From local_passwd.c (C) Regents of Univ. of California blah blah */ > static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ > "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; > > to64(s, v, n) > register char *s; > register long v; > register int n; > { > while (--n >= 0) { > *s++ = itoa64[v&0x3f]; > v >>= 6; > } > } > > char *crypt(char *pw, char *salt); /* why aren't these prototyped in include */ > > void add_password(char *user,char *pw) { > char *cpw, *pru, salt[3]; > > (void)srand((int)time((time_t *)NULL)); > to64(&salt[0],rand(),2); > cpw = crypt(pw,salt); > printf("%s",cpw); > } > main(int argc, char *argv[]) { > char user[MAX_STRING_LEN]; > char line[MAX_STRING_LEN]; > char l[MAX_STRING_LEN]; > char w[MAX_STRING_LEN]; > char command[MAX_STRING_LEN]; > int found; > > tn = NULL; > add_password(argv[1],argv[2]); > } > > but i get this mesg > > gcc -o genpass genpass.c > /var/tmp/cc0159851.o: Undefined symbol `_crypt' referenced > > any idea? gcc -o genpass -lcrypt genpass.c Denis V. Talonin > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message