#include <mit-copyright.h>
#include <moira.h>
#include <moira_site.h>
+#include <mrclient.h>
#include <ctype.h>
#include <errno.h>
{
int status, lineno;
char **arg = argv, *qargv[U_END];
- char *motd, *p, *first, *middle, *last, *id, *login, *server;
+ char *p, *first, *middle, *last, *id, *login, *server;
char buf[BUFSIZ], idbuf[32];
FILE *input;
}
/* fire up Moira */
- if ((status = mr_connect(server)))
- {
- com_err(whoami, status, "unable to connect to the Moira server");
- exit(2);
- }
- if ((status = mr_motd(&motd)))
- {
- com_err(whoami, status, "unable to check server status");
- exit(2);
- }
- if (motd)
- {
- fprintf(stderr, "The Moira server is currently unavailable:\n%s\n",
- motd);
- mr_disconnect();
- exit(2);
- }
-
- if ((status = mr_auth("addusr")))
- {
- if (status == MR_USER_AUTH)
- com_err(whoami, status, "");
- else
- {
- com_err(whoami, status, "unable to authenticate to Moira");
- exit(2);
- }
- }
+ if (mrcl_connect(server, "addusr", 1) != MRCL_SUCCESS)
+ exit(2);
qargv[U_NAME] = UNIQUE_LOGIN;
qargv[U_UID] = UNIQUE_UID;