]> andersk Git - moira.git/blame - lib/mr_auth.c
Made the default version number 2
[moira.git] / lib / mr_auth.c
CommitLineData
e2a67c78 1/*
2 * $Source$
3 * $Author$
4 * $Header$
5 *
6 * Copyright (C) 1987 by the Massachusetts Institute of Technology
7 *
8 * $Log$
89371417 9 * Revision 1.5 1988-04-19 12:40:29 mar
10 * pass version number on queries
e2a67c78 11 *
89371417 12 * Revision 1.4 87/10/20 15:09:22 mar
13 * replace hardcoded ATHENA realm with call to get_krbrlm();
14 *
a29db7d1 15 * Revision 1.3 87/06/16 17:47:20 wesommer
16 * Clean up memory allocation, indenting.
17 *
83e80378 18 * Revision 1.2 87/05/31 22:03:23 wesommer
19 * It's working better.
20 *
20e1c093 21 * Revision 1.1 87/05/20 03:11:18 wesommer
22 * Initial revision
23 *
e2a67c78 24 *
25 * Handles the client side of the sending of authenticators to
26 * the sms server.
27 */
28
29#ifndef lint
30static char *rcsid_sms_auth_c = "$Header$";
31#endif lint
32
33#include "sms_private.h"
34#include <krb.h>
35
20e1c093 36extern int krb_err_base;
37
e2a67c78 38int sms_auth()
39{
83e80378 40 register int status;
41 sms_params params_st;
42 char *args[1];
43 int argl[1];
a29db7d1 44 char realm[REALM_SZ];
45
83e80378 46 register sms_params *params = &params_st;
47 sms_params *reply = NULL;
48 KTEXT_ST auth;
49
50 CHECK_CONNECTED;
e2a67c78 51
83e80378 52 /*
53 * Build a Kerberos authenticator.
54 * The "service" and "instance" should not be hardcoded here.
55 */
e2a67c78 56
a29db7d1 57 if ((status = get_krbrlm(realm, 1)) != KSUCCESS) {
58 return status;
59 }
60 status = mk_ap_req(&auth, "sms", "sms", realm, 0);
83e80378 61 if (status != KSUCCESS) {
62 status += krb_err_base;
63 return status;
89371417 64 }
65 params->sms_version_no = sending_version_no;
83e80378 66 params->sms_procno = SMS_AUTH;
67 params->sms_argc = 1;
68 params->sms_argv = args;
69 params->sms_argl = argl;
70 params->sms_argv[0] = (char *)auth.dat;
71 params->sms_argl[0] = auth.length;
e2a67c78 72
83e80378 73 if ((status = sms_do_call(params, &reply)) == 0)
74 status = reply->sms_status;
e2a67c78 75
83e80378 76 sms_destroy_reply(reply);
77
78 return status;
e2a67c78 79}
83e80378 80
81/*
82 * Local Variables:
83 * mode: c
84 * c-indent-level: 4
85 * c-continued-statement-offset: 4
86 * c-brace-offset: -4
87 * c-argdecl-indent: 4
88 * c-label-offset: -4
89 * End:
90 */
This page took 0.059547 seconds and 5 git commands to generate.