#include <mit-copyright.h>
#include <moira.h>
+#include <mrclient.h>
#include "defs.h"
#include "f_defs.h"
#include "globals.h"
}
}
- if ((status = mr_connect(moira_server)))
- ErrorExit("\nConnection to Moira server failed", status);
-
- /* do this now since calling mr_connect initialized the krb error table
- * for us.
- */
- if ((status = tf_init(TKT_FILE, R_TKT_FIL)) ||
- (status = tf_get_pname(pname)))
- {
- com_err(whoami, status, "cannot find your ticket file");
- exit(1);
- }
- tf_close();
- user = strdup(pname);
-
- if ((status = mr_motd(&motd)))
- ErrorExit("\nUnable to check server status", status);
- if (motd)
- {
- fprintf(stderr, "The Moira server is currently unavailable:\n%s\n",
- motd);
- mr_disconnect();
- exit(1);
- }
+ if (mrcl_connect(moira_server, program_name, QUERY_VERSION, 0)
+ != MRCL_SUCCESS)
+ exit(1);
if ((status = mr_auth(program_name)))
{