File:  [Research Unix] / researchv10no / cmd / sign / resign.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

#include <stdio.h>
#include <string.h>


extern char *getpass();
extern char *getlogin();
extern void exit();
char name[10];

main()
{
	strcpy(name,getlogin());

	return enrollfn();
}

enrollfn()
{
	char *opw1, *opw2, *pw;

	pw = "";

	opw1 = getpass("Signature key:");
	if(opw1) opw1 = strdup(opw1);
	if(opw1) opw2 = getpass("Again:");
	if(opw1==0 || opw2==0) {
		fprintf(stderr,"resign: failed to get password\n");
		exit(1);
	}
	if(strcmp(opw1,opw2)!=0) exit(1);

	switch( enroll(name, opw1, pw) ) {
	case 0:
		printf("BAD resign of %s\n", name);
		return 1;
		break;
	default:
		printf("Server uncommunicative; try again later\n");
		return 1;
		break;
	case 1:
		printf("GOOD resign of %s\n", name);
		return 0;
		break;
	}
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.