Release bumped to "gts4".
[tac_plus.git] / author.c
index a9f2277..7a05db5 100644 (file)
--- a/author.c
+++ b/author.c
@@ -1,4 +1,4 @@
-/* 
+/*
    Copyright (c) 1995-1998 by Cisco systems, Inc.
 
    Permission to use, copy, modify, and distribute this software for
    FITNESS FOR A PARTICULAR PURPOSE.
 */
 
+
 #include "tac_plus.h"
 
+#include <stdlib.h>
+#include <netinet/in.h>                /* for ntohl() */
+
+#include "author.h"
+#include "report.h"
+#include "packet.h"
+#include "utils.h"
+#include "do_author.h"
+#include "main.h"
+#include "cfgfile.h"
+
+
 /*
  *  Come here when we receive an authorization START packet
  */
 
+void author TAC_ARGS((u_char *pak));
+
 void
 author(pak)
 u_char *pak;
@@ -34,7 +49,8 @@ u_char *pak;
     u_char *p;
     u_char *argsizep;
     char **cmd_argp;
-    int i, len;
+    int i;
+    unsigned long len;
 
     if (debug & DEBUG_AUTHOR_FLAG)
        report(LOG_DEBUG, "Start authorization request");
@@ -58,7 +74,7 @@ u_char *pak;
        len += p[i];
     }
 
-    if (len != ntohl(hdr->datalength)) {
+    if (len != (unsigned long) ntohl(hdr->datalength)) {
        send_error_reply(TAC_PLUS_AUTHOR, NULL);
        return;
     }
@@ -95,6 +111,8 @@ u_char *pak;
 
     identity.priv_lvl = apak->priv_lvl;
 
+    cfg_request_identity(&identity);
+
     /* The author_data structure */
 
     author_data.id = &identity;        /* user id */
@@ -148,7 +166,7 @@ u_char *pak;
     if (author_data.input_args) {
        for (i = 0; i < author_data.num_in_args; i++)
            free(author_data.input_args[i]);
-       
+
        free(author_data.input_args);
        author_data.input_args = NULL;
     }