#include <mit-copyright.h>
#include <moira.h>
+#include <mrclient.h>
#include "defs.h"
#include "f_defs.h"
#include "globals.h"
* Returns: doesn't return.
*/
-void main(int argc, char **argv)
+int main(int argc, char **argv)
{
int status;
Menu *menu;
program_name = strdup(program_name);
whoami = strdup(program_name); /* used by menu.c, ugh !!! */
+ user = mrcl_krb_user();
+ if (!user)
+ exit(1);
+
verbose = TRUE;
arg = argv;
moira_server = NULL;
}
}
- 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)))
{