Date: Wed, 22 Apr 1998 11:17:58 -0700 From: "Leon Felipe Rodriguez J. -CENCAR" <leonf@osiris.staff.udg.mx> To: freebsd-hackers@FreeBSD.ORG Subject: Undefined symbol `_crypt' referenced from text segment Message-ID: <9804221117.ZM29375@osiris.staff.udg.mx>
next in thread | raw e-mail | index | archive | help
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 <sys/types.h> #include <stdio.h> #include <string.h> #include <sys/signal.h> #include <stdlib.h> #include <time.h> #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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9804221117.ZM29375>