]> andersk Git - moira.git/blobdiff - lib/mr_auth.c
Initial revision
[moira.git] / lib / mr_auth.c
index daf436f299ade381c73bdf4b35a25acdaed11c91..3316d3efe3d34f1ac7a4bc41a2070d0296a26be5 100644 (file)
@@ -4,20 +4,8 @@
  *     $Header$
  *
  *     Copyright (C) 1987 by the Massachusetts Institute of Technology
- *
- *     $Log$
- *     Revision 1.4  1987-10-20 15:09:22  mar
- *     replace hardcoded ATHENA realm with call to get_krbrlm();
- *
- * Revision 1.3  87/06/16  17:47:20  wesommer
- * Clean up memory allocation, indenting.
- * 
- * Revision 1.2  87/05/31  22:03:23  wesommer
- * It's working better.
- * 
- * Revision 1.1  87/05/20  03:11:18  wesommer
- * Initial revision
- * 
+ *     For copying and distribution information, please see the file
+ *     <mit-copyright.h>.
  *
  *     Handles the client side of the sending of authenticators to
  * the sms server.     
 static char *rcsid_sms_auth_c = "$Header$";
 #endif lint
 
+#include <mit-copyright.h>
 #include "sms_private.h"
 #include <krb.h>
 
 extern int krb_err_base;
 
-int sms_auth()
+/* Authenticate this client with the SMS server.  prog is the name of the
+ * client program, and will be recorded in the database.
+ */
+
+int sms_auth(prog)
+char *prog;
 {
     register int status;
     sms_params params_st;
-    char *args[1];
-    int argl[1];
+    char *args[2];
+    int argl[2];
     char realm[REALM_SZ];
 
     register sms_params *params = &params_st;
@@ -54,18 +48,24 @@ int sms_auth()
     if ((status = get_krbrlm(realm, 1)) != KSUCCESS) {
        return status;
     }
-    status = mk_ap_req(&auth, "sms", "sms", realm, 0);
+    status = krb_mk_req(&auth, "sms", "sms", realm, 0);
     if (status != KSUCCESS) {
        status += krb_err_base;
        return status;
-    }
+    } 
+    params->sms_version_no = sending_version_no;
     params->sms_procno = SMS_AUTH;
-    params->sms_argc = 1;
+    params->sms_argc = 2;
     params->sms_argv = args;
     params->sms_argl = argl;
     params->sms_argv[0] = (char *)auth.dat;
     params->sms_argl[0] = auth.length;
+    params->sms_argv[1] = prog;
+    params->sms_argl[1] = strlen(prog) + 1;
        
+    if (sending_version_no == SMS_VERSION_1)
+       params->sms_argc = 1;
+
     if ((status = sms_do_call(params, &reply)) == 0)
        status = reply->sms_status;
 
This page took 0.044269 seconds and 4 git commands to generate.