|
|
1.1 root 1: #include <stdio.h>
2: #include <string.h>
3:
4:
5: extern char *getpass();
6: extern char *getlogin();
7: extern void exit();
8: char name[10];
9:
10: main()
11: {
12: strcpy(name,getlogin());
13:
14: return enrollfn();
15: }
16:
17: enrollfn()
18: {
19: char *opw1, *opw2, *pw;
20:
21: pw = "";
22:
23: opw1 = getpass("Signature key:");
24: if(opw1) opw1 = strdup(opw1);
25: if(opw1) opw2 = getpass("Again:");
26: if(opw1==0 || opw2==0) {
27: fprintf(stderr,"resign: failed to get password\n");
28: exit(1);
29: }
30: if(strcmp(opw1,opw2)!=0) exit(1);
31:
32: switch( enroll(name, opw1, pw) ) {
33: case 0:
34: printf("BAD resign of %s\n", name);
35: return 1;
36: break;
37: default:
38: printf("Server uncommunicative; try again later\n");
39: return 1;
40: break;
41: case 1:
42: printf("GOOD resign of %s\n", name);
43: return 0;
44: break;
45: }
46: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.