]> andersk Git - moira.git/blobdiff - lib/mr_auth.c
#define the zephyr stuff & add syslog definitions as well
[moira.git] / lib / mr_auth.c
index 3316d3efe3d34f1ac7a4bc41a2070d0296a26be5..4d7c717cb662ca23cfba9c176d4ce403bf42d3de 100644 (file)
@@ -18,8 +18,7 @@ static char *rcsid_sms_auth_c = "$Header$";
 #include <mit-copyright.h>
 #include "sms_private.h"
 #include <krb.h>
-
-extern int krb_err_base;
+#include <krb_et.h>
 
 /* Authenticate this client with the SMS server.  prog is the name of the
  * client program, and will be recorded in the database.
@@ -33,6 +32,7 @@ char *prog;
     char *args[2];
     int argl[2];
     char realm[REALM_SZ];
+    char host[BUFSIZ];
 
     register sms_params *params = &params_st;
     sms_params *reply = NULL;
@@ -45,12 +45,15 @@ char *prog;
      * The "service" and "instance" should not be hardcoded here.
      */
        
-    if ((status = get_krbrlm(realm, 1)) != KSUCCESS) {
+    bzero(host, sizeof(host));
+    if (status = sms_host(host, sizeof(host) - 1))
        return status;
-    }
+
+    strcpy(realm, krb_realmofhost(host));
+
     status = krb_mk_req(&auth, "sms", "sms", realm, 0);
     if (status != KSUCCESS) {
-       status += krb_err_base;
+       status += ERROR_TABLE_BASE_krb;
        return status;
     } 
     params->sms_version_no = sending_version_no;
@@ -73,14 +76,3 @@ char *prog;
 
     return status;
 }
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
This page took 0.031358 seconds and 4 git commands to generate.