]> andersk Git - moira.git/blobdiff - server/mr_sauth.c
update for use with new com_err library
[moira.git] / server / mr_sauth.c
index 2027f32dd0c8d27cb4d4167be5f78dec8d3f0902..b0d1b0a4edb3356b5f9b4d028c92fef1fa907a00 100644 (file)
@@ -4,6 +4,8 @@
  *     $Header$
  *
  *     Copyright (C) 1987 by the Massachusetts Institute of Technology
+ *     For copying and distribution information, please see the file
+ *     <mit-copyright.h>.
  *
  */
 
 static char *rcsid_sms_sauth_c = "$Header$";
 #endif lint
 
-extern int krb_err_base;
+#include <mit-copyright.h>
 #include <strings.h>
 #include "sms_server.h"
+#include <krb_et.h>
 
 extern char buf1[];
 extern char *whoami;
@@ -35,7 +38,6 @@ do_auth(cl)
        AUTH_DAT ad;
        int status;
        char buf[REALM_SZ+INST_SZ+ANAME_SZ];
-       extern int krb_err_base;
        static char *unknown = "???";
        
        if (cl->clname) {
@@ -54,8 +56,8 @@ do_auth(cl)
        auth.mbz = 0;
        
        if ((status = krb_rd_req (&auth, "sms", "sms", cl->haddr.sin_addr,
-                                &ad, "")) != KSUCCESS) {
-               status += krb_err_base;
+                                &ad, "")) != 0) {
+               status += ERROR_TABLE_BASE_krb;
                cl->reply.sms_status = status;
                if (log_flags & LOG_RES)
                        com_err(whoami, status, "(authentication failed)");
@@ -92,4 +94,6 @@ do_auth(cl)
        if (log_flags & LOG_RES)
            com_err(whoami, 0, "Authenticated to %s using %s, id %d",
                    cl->clname, cl->entity, cl->users_id);
+       if (cl->users_id == 0)
+         cl->reply.sms_status = SMS_USER_AUTH;
 }
This page took 0.03442 seconds and 4 git commands to generate.