]> andersk Git - moira.git/blob - lib/mr_auth.c
pass version number on queries
[moira.git] / lib / mr_auth.c
1 /*
2  *      $Source$
3  *      $Author$
4  *      $Header$
5  *
6  *      Copyright (C) 1987 by the Massachusetts Institute of Technology
7  *
8  *      $Log$
9  *      Revision 1.5  1988-04-19 12:40:29  mar
10  *      pass version number on queries
11  *
12  * Revision 1.4  87/10/20  15:09:22  mar
13  * replace hardcoded ATHENA realm with call to get_krbrlm();
14  * 
15  * Revision 1.3  87/06/16  17:47:20  wesommer
16  * Clean up memory allocation, indenting.
17  * 
18  * Revision 1.2  87/05/31  22:03:23  wesommer
19  * It's working better.
20  * 
21  * Revision 1.1  87/05/20  03:11:18  wesommer
22  * Initial revision
23  * 
24  *
25  *      Handles the client side of the sending of authenticators to
26  * the sms server.      
27  */
28
29 #ifndef lint
30 static char *rcsid_sms_auth_c = "$Header$";
31 #endif lint
32
33 #include "sms_private.h"
34 #include <krb.h>
35
36 extern int krb_err_base;
37
38 int sms_auth()
39 {
40     register int status;
41     sms_params params_st;
42     char *args[1];
43     int argl[1];
44     char realm[REALM_SZ];
45
46     register sms_params *params = &params_st;
47     sms_params *reply = NULL;
48     KTEXT_ST auth;
49
50     CHECK_CONNECTED;
51         
52     /*
53      * Build a Kerberos authenticator.
54      * The "service" and "instance" should not be hardcoded here.
55      */
56         
57     if ((status = get_krbrlm(realm, 1)) != KSUCCESS) {
58         return status;
59     }
60     status = mk_ap_req(&auth, "sms", "sms", realm, 0);
61     if (status != KSUCCESS) {
62         status += krb_err_base;
63         return status;
64     } 
65     params->sms_version_no = sending_version_no;
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;
72         
73     if ((status = sms_do_call(params, &reply)) == 0)
74         status = reply->sms_status;
75
76     sms_destroy_reply(reply);
77
78     return status;
79 }
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.053058 seconds and 5 git commands to generate.