From owner-freebsd-hackers Wed Apr 22 09:18:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA11892 for freebsd-hackers-outgoing; Wed, 22 Apr 1998 09:18:30 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from osiris.staff.udg.mx (leonf@[148.202.3.54]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA11755 for ; Wed, 22 Apr 1998 16:18:15 GMT (envelope-from leonf@osiris.staff.udg.mx) Received: (from leonf@localhost) by osiris.staff.udg.mx (8.8.7/8.8.7) id QAA29377 for freebsd-hackers@freebsd.org; Wed, 22 Apr 1998 16:18:00 GMT From: "Leon Felipe Rodriguez J. -CENCAR" Message-Id: <9804221117.ZM29375@osiris.staff.udg.mx> Date: Wed, 22 Apr 1998 11:17:58 -0700 X-Mailer: Z-Mail (3.2.0 26oct94 MediaMail) To: freebsd-hackers@FreeBSD.ORG Subject: Undefined symbol `_crypt' referenced from text segment Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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? Thanx To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message