* admin_server, and is a server for the userreg program.
*
* $Log$
- * Revision 1.4 1987-09-04 23:33:19 wesommer
- * Deleted test scaffolding (second oops.)
+ * Revision 1.5 1987-09-10 22:18:32 wesommer
+ * Clean up output format.
*
+ * Revision 1.4 87/09/04 23:33:19 wesommer
+ * Deleted test scaffolding (second oops.)
+ *
* Revision 1.3 87/09/03 03:05:18 wesommer
* Version used for userreg tests.
*
extern char admin_errmsg[];
long now;
-#define STAMP { time (&now); printf(ctime(&now)); }
struct msg {
u_long version;
}
for (;;) {
- printf("waiting..");
- fflush(stdout);
+ com_err("reg_svr", 0, "Ready for next request");
addrlen = sizeof(sin);
bzero(retval, BUFSIZ);
len = recvfrom(s, buf, BUFSIZ, 0, &sin, &addrlen);
int len;
int i;
-#ifdef notdef
- for (i = 0; i < message->sealed_len; i++) {
- printf("%02x ", (unsigned char)message->sealed[i]);
- }
- printf("\n");
-#endif notdef
mit_id = 0;
string_to_key(db_mit_id, key);
key_sched(key, sched);
pcbc_encrypt(message->sealed, decrypt, message->sealed_len, sched, key, 0);
-#ifdef notdef
- for (i = 0; i < message->sealed_len; i++) {
- printf("%02x ", (unsigned char)decrypt[i]);
- }
- printf("\n");
- for (i = 0; i < message->sealed_len; i++) {
- if (isprint(decrypt[i]))
- printf("%c ", (unsigned char)decrypt[i]);
- else printf(". ");
- }
- printf("\n");
-#endif notdef
(void) strncpy(idnumber, decrypt, message->sealed_len);
temp = decrypt + strlen(idnumber) + 1;
len = message->sealed_len - (temp - decrypt);
char *firstname, *lastname;
int status;
-#ifdef debug
- printf("Callback: %s %s %s\n", argv[8], argv[5], argv[4]);
-#endif debug
if (got_one) return 0;
reg_status = 0;
char *argv[3];
int status;
- printf("verify_user\n");
+ com_err("reg_svr", 0, " verify_user %s %s\n",
+ message->first, message->last);
argv[0] = "get_user_by_first_and_last";
argv[1] = message->first;
argv[2] = message->last;
char *login;
char uid_buf[20];
- STAMP;
- printf("reserve_user\n");
+ com_err("reg_svr", 0, " reserve_user %s %s\n",
+ message->first, message->last);
argv[0] = "gufl"; /* get_user_by_first_and_last */
argv[1] = message->first;
status = sms_query_internal(3, argv, vfy_callbk, (char *)message);
- STAMP;
-
if (status == SMS_NO_MATCH) status = UREG_USER_NOT_FOUND;
if (!got_one && !status)
status = UREG_USER_NOT_FOUND;
status = 0;
goto punt;
}
- /* Sanity check requested login name. */
- printf("reg_misc_len = %d\n", reg_misc_len);
for (i = 0; i < reg_misc_len && reg_misc[i]; i++) {
if (!islower(reg_misc[i])) {
/* Send request to kerberos admin_server for login name */
/* get keys */
- printf("get_svc_in_tkt\n");
- status = get_svc_in_tkt("register", "kerberos", "ATHENA.MIT.EDU",
+ status = get_svc_in_tkt("register", "sms", "ATHENA.MIT.EDU",
"changepw", "kerberos",
1, "/etc/srvtab");
if (status) {
status += krb_err_base;
goto punt;
}
- STAMP;
- printf("admin_call\n");
/* send set password request to kerberos admin_server */
(void) sprintf(uid_buf, "%013d", user_id); /* 13 chars of placebo */
/* for backwards-compat. */
dest_tkt();
/* If valid: */
- STAMP;
/* Set login name */
status = set_login(login, mit_id);
goto punt;
}
/* choose post office */
- STAMP;
status = choose_pobox(login);
if (status) {
goto punt;
}
/* create group */
- STAMP;
status = create_group(login);
if (status == SMS_LIST) status = UREG_LOGIN_USED;
goto punt;
}
/* set quota entry, create filsys */
- STAMP;
status = alloc_filsys(login, SMS_FS_STUDENT, 0, 0);
if (status == SMS_FILESYS_EXISTS) status = UREG_LOGIN_USED;
goto punt;
}
/* set filsys and status in SMS database */
- STAMP;
status = set_status_filsys(reg_misc, mit_id);
if (status) {
}
punt:
dest_tkt();
- STAMP;
- printf("reserve_user returning %s\n", error_message(status));
+
+ com_err("reg_svr", status, " returned from reserve_user");
return status;
}
{
char *argv[3];
int status;
+ char uid_buf[10];
- printf("set_password\n");
+ com_err("reg_svr", 0, " set_password %s %s\n",
+ message->first, message->last);
/* validate that user is who he claims to be */
goto punt;
}
- printf("password for %s would be set to %s\n", retval ,reg_misc);
-
/* get keys */
- status = get_svc_in_tkt("register", "kerberos", "ATHENA.MIT.EDU",
+ status = get_svc_in_tkt("register", "sms", "ATHENA.MIT.EDU",
"changepw", "kerberos",
1, "/etc/srvtab");
if (status) {
status += krb_err_base;
goto punt;
}
+
+ (void) sprintf(uid_buf, "%013d", user_id); /* 13 chars of placebo */
+ /* for backwards-compat. */
/* send set password request to kerberos admin_server */
- status = admin_call(ADMIN_SET_KDC_PASSWORD, retval, "",
- reg_misc, "BBBBBBBBBBBBB");
+ status = admin_call(ADMIN_ADD_NEW_KEY_ATTR, retval, "",
+ reg_misc, uid_buf);
if (status) goto punt;
dest_tkt();