enigma.c (78781) | enigma.c (79452) |
---|---|
1/* 2 * "enigma.c" is in file cbw.tar from 3 * anonymous FTP host watmsg.waterloo.edu: pub/crypt/cbw.tar.Z 4 * 5 * A one-rotor machine designed along the lines of Enigma 6 * but considerably trivialized. 7 * 8 * A public-domain replacement for the UNIX "crypt" command. 9 * 10 * Upgraded to function properly on 64-bit machines. 11 */ 12 13#ifndef lint 14static const char rcsid[] = | 1/* 2 * "enigma.c" is in file cbw.tar from 3 * anonymous FTP host watmsg.waterloo.edu: pub/crypt/cbw.tar.Z 4 * 5 * A one-rotor machine designed along the lines of Enigma 6 * but considerably trivialized. 7 * 8 * A public-domain replacement for the UNIX "crypt" command. 9 * 10 * Upgraded to function properly on 64-bit machines. 11 */ 12 13#ifndef lint 14static const char rcsid[] = |
15 "$FreeBSD: head/usr.bin/enigma/enigma.c 78781 2001-06-25 21:25:27Z dd $"; | 15 "$FreeBSD: head/usr.bin/enigma/enigma.c 79452 2001-07-09 09:24:06Z brian $"; |
16#endif /* not lint */ 17 18#include <sys/types.h> 19#include <sys/wait.h> 20 21#include <stdio.h> 22#include <stdlib.h> 23#include <string.h> --- 27 unchanged lines hidden (view full) --- 51 buf[8] = buf[0]; 52 buf[9] = buf[1]; 53 pipe(pf); 54 if ((pid=fork())==0) { 55 close(0); 56 close(1); 57 dup(pf[0]); 58 dup(pf[1]); | 16#endif /* not lint */ 17 18#include <sys/types.h> 19#include <sys/wait.h> 20 21#include <stdio.h> 22#include <stdlib.h> 23#include <string.h> --- 27 unchanged lines hidden (view full) --- 51 buf[8] = buf[0]; 52 buf[9] = buf[1]; 53 pipe(pf); 54 if ((pid=fork())==0) { 55 close(0); 56 close(1); 57 dup(pf[0]); 58 dup(pf[1]); |
59 execlp("makekey", "-", 0); 60 execl("/usr/libexec/makekey", "-", 0); /* BSDI */ 61 execl("/usr/lib/makekey", "-", 0); 62 execl("/usr/bin/makekey", "-", 0); /* IBM */ 63 execl("/lib/makekey", "-", 0); | 59 execlp("makekey", "-", (char *)0); 60 execl("/usr/libexec/makekey", "-", (char *)0); /* BSDI */ 61 execl("/usr/lib/makekey", "-", (char *)0); 62 execl("/usr/bin/makekey", "-", (char *)0); /* IBM */ 63 execl("/lib/makekey", "-", (char *)0); |
64 perror("makekey"); 65 fprintf(stderr, "enigma: cannot execute 'makekey', aborting\n"); 66 exit(1); 67 } 68 write(pf[1], buf, 10); 69 close(pf[1]); 70 i=wait((int *)NULL); 71 if (i<0) perror("enigma: wait"); --- 119 unchanged lines hidden --- | 64 perror("makekey"); 65 fprintf(stderr, "enigma: cannot execute 'makekey', aborting\n"); 66 exit(1); 67 } 68 write(pf[1], buf, 10); 69 close(pf[1]); 70 i=wait((int *)NULL); 71 if (i<0) perror("enigma: wait"); --- 119 unchanged lines hidden --- |