X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=tools%2Fmkpasswd.c;fp=tools%2Fmkpasswd.c;h=0000000000000000000000000000000000000000;hb=fcf52c3281ec0807468c78e99bf330dc95d3cdaf;hp=a36493a63ebd48b6836be53cefce60bcd37fb6b5;hpb=445d6eb3d126fb8a01e7b436fd53af5a1cfd0b58;p=ircu2.10.12-pk.git diff --git a/tools/mkpasswd.c b/tools/mkpasswd.c deleted file mode 100644 index a36493a..0000000 --- a/tools/mkpasswd.c +++ /dev/null @@ -1,40 +0,0 @@ -/* simple password generator by Nelson Minar (minar@reed.edu) - * copyright 1991, all rights reserved. - * You can use this code as long as my name stays with it. - * $Id$ - */ -#define _XOPEN_SOURCE -#define _XOPEN_VERSION 4 -#define _XOPEN_SOURCE_EXTENDED -#include -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - static char saltChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; - char salt[3]; - char * plaintext; - - if (argc < 2) { - srandom(time(0)); /* may not be the BEST salt, but its close */ - salt[0] = saltChars[random() % 64]; - salt[1] = saltChars[random() % 64]; - salt[2] = 0; - } - else { - salt[0] = argv[1][0]; - salt[1] = argv[1][1]; - salt[2] = '\0'; - if ((strchr(saltChars, salt[0]) == NULL) || (strchr(saltChars, salt[1]) == NULL)) - fprintf(stderr, "illegal salt %s\n", salt), exit(1); - } - - plaintext = getpass("plaintext: "); - - printf("%s\n", crypt(plaintext, salt)); - return 0; -} -