]> andersk Git - moira.git/blob - lib/mr_auth.c
852bf251508efd5df3d51803da489368e1b122e7
[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.3  1987-06-16 17:47:20  wesommer
10  *      Clean up memory allocation, indenting.
11  *
12  * Revision 1.2  87/05/31  22:03:23  wesommer
13  * It's working better.
14  * 
15  * Revision 1.1  87/05/20  03:11:18  wesommer
16  * Initial revision
17  * 
18  *
19  *      Handles the client side of the sending of authenticators to
20  * the sms server.      
21  */
22
23 #ifndef lint
24 static char *rcsid_sms_auth_c = "$Header$";
25 #endif lint
26
27 #include "sms_private.h"
28 #include <krb.h>
29
30 extern int krb_err_base;
31
32 int sms_auth()
33 {
34     register int status;
35     sms_params params_st;
36     char *args[1];
37     int argl[1];
38     
39     register sms_params *params = &params_st;
40     sms_params *reply = NULL;
41     KTEXT_ST auth;
42
43     CHECK_CONNECTED;
44         
45     /*
46      * Build a Kerberos authenticator.
47      * The "service" and "instance" should not be hardcoded here.
48      */
49         
50     status = mk_ap_req(&auth, "sms", "sms", "ATHENA.MIT.EDU", 0);
51     if (status != KSUCCESS) {
52         status += krb_err_base;
53         return status;
54     }
55     params->sms_procno = SMS_AUTH;
56     params->sms_argc = 1;
57     params->sms_argv = args;
58     params->sms_argl = argl;
59     params->sms_argv[0] = (char *)auth.dat;
60     params->sms_argl[0] = auth.length;
61         
62     if ((status = sms_do_call(params, &reply)) == 0)
63         status = reply->sms_status;
64
65     sms_destroy_reply(reply);
66
67     return status;
68 }
69
70 /*
71  * Local Variables:
72  * mode: c
73  * c-indent-level: 4
74  * c-continued-statement-offset: 4
75  * c-brace-offset: -4
76  * c-argdecl-indent: 4
77  * c-label-offset: -4
78  * End:
79  */
This page took 0.031882 seconds and 3 git commands to generate.