+ status = mr_connect(moira_server);
+ if (status) {
+ com_err(program_name, status, " connecting to server");
+ exit(1);
+ }
+ status = mr_motd(&motd);
+ if (status) {
+ com_err(program_name, status, " connecting to server");
+ exit(1);
+ }
+ if (motd) {
+ fprintf(stderr, "The Moira server is currently unavailable:\n%s\n",
+ motd);
+ mr_disconnect();
+ exit(1);
+ }
+
+ status = mr_auth("mmoira");
+ if (status == MR_USER_AUTH) {
+ char buf[BUFSIZ];
+ com_err(program_name, status, "\nPress [RETURN] to continue");
+ gets(buf);
+ } else if (status) {
+ if (status >= ERROR_TABLE_BASE_krb &&
+ status <= ERROR_TABLE_BASE_krb + 256)
+ com_err(program_name, status, "; authorization failed - please run kinit");
+ else
+ com_err(program_name, status, "; authorization failed");
+ exit(1);
+ }