3 * Handles the client side of the sending of authenticators to the moira server
5 * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
6 * For copying and distribution information, please see the file
10 #include <mit-copyright.h>
12 #include "mr_private.h"
22 /* Authenticate this client with the Moira server. prog is the name of the
23 * client program, and will be recorded in the database.
26 int mr_auth(char *prog)
29 mr_params params, reply;
32 char realm[REALM_SZ], host[BUFSIZ], *p;
37 if ((status = mr_host(host, sizeof(host) - 1)))
40 strcpy(realm, krb_realmofhost(host));
41 for (p = host; *p && *p != '.'; p++)
48 status = krb_mk_req(&auth, MOIRA_SNAME, host, realm, 0);
49 if (status != KSUCCESS)
51 status += ERROR_TABLE_BASE_krb;
54 params.u.mr_procno = MR_AUTH;
56 params.mr_argv = args;
57 params.mr_argl = argl;
58 params.mr_argv[0] = (char *)auth.dat;
59 params.mr_argl[0] = auth.length;
60 params.mr_argv[1] = prog;
61 params.mr_argl[1] = strlen(prog) + 1;
63 if ((status = mr_do_call(¶ms, &reply)) == MR_SUCCESS)
64 status = reply.u.mr_status;
66 mr_destroy_reply(reply);