3 /* (c) Copyright 1988 by the Massachusetts Institute of Technology. */
4 /* For copying and distribution information, please see the file */
5 /* <mit-copyright.h>. */
8 #include <mit-copyright.h>
12 int debug=0; /* goddamn des library breakage */
13 char string[] = "sms\0\0Athena\0\1";
14 char srvtab[] = "/etc/srvtab";
16 "\7\7\7This program MUST be run on the console, for security reasons.\n";
24 char *tty, *ttyname();
26 if (!tty || strcmp(tty, "/dev/console")) {
27 fprintf(stderr, insecure);
30 fd = open(srvtab, O_WRONLY|O_APPEND, 0);
35 if (sizeof(string)-1 != 13) {
36 fprintf(stderr, "string size bad\n");
39 des_read_password(key, "Enter SMS update password: ", 0);
40 write(fd, string, sizeof(string)-1);
41 write(fd, key, sizeof(C_Block));
45 printf("\nKey written.\n");