1 #include "config.h" 2 /* 3 ** Copyright 2000-2001 Double Precision, Inc. See COPYING for 4 ** distribution information. 5 */ 6 7 #include "auth.h" 8 #include <stdio.h> 9 #include <stdlib.h> 10 #include <string.h> 11 #if HAVE_UNISTD_H 12 #include <unistd.h> 13 #endif 14 #include <fcntl.h> 15 #include <unistd.h> 16 #include <stdlib.h> 17 #include <errno.h> 18 #include <signal.h> 19 20 21 extern int authdaemondopasswd(char *, int); 22 main()23int main() 24 { 25 char buf[BUFSIZ]; 26 char *p; 27 28 strcpy(buf,"PASSWD "); 29 30 if (fgets(buf+7, sizeof(buf)-10, stdin) == NULL) 31 exit(1); 32 33 if ((p=strchr(buf, '\n')) != 0) 34 *p=0; 35 36 strcat(buf, "\n"); 37 signal(SIGPIPE, SIG_IGN); 38 if (authdaemondopasswd(buf, sizeof(buf))) 39 { 40 sleep(5); 41 exit(1); 42 } 43 exit(0); 44 return (0); 45 } 46