Release bumped to "gts4".
[tac_plus.git] / sendpass.c
index f7f0b3c..9d8ab00 100644 (file)
@@ -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 "sendpass.h"
 #include "expire.h"
+#include "report.h"
+#include "utils.h"
+#include "cfgfile.h"
+#include "choose_authen.h"             /* for "struct authen_data" */
+#include "do_author.h"                 /* for "struct identity" */
+#include "main.h"
+#include "packet.h"
 
-static int
-do_sendpass_fn();
+
+static int do_sendpass_fn TAC_ARGS((struct authen_data *data));
+
+
+int sendpass_fn TAC_ARGS((struct authen_data *data));
 
 int sendpass_fn(data)
 struct authen_data *data;
@@ -48,8 +61,8 @@ struct authen_data *data;
     if (debug)
        report(LOG_INFO, "sendpass query for '%s' %s from %s %s",
               name && name[0] ? name : "unknown",
-              port && port[0] ? port : "unknown", 
-              session.peer, 
+              port && port[0] ? port : "unknown",
+              session.peer,
               (data->status == TAC_PLUS_AUTHEN_STATUS_PASS) ?
               "accepted" : "rejected");
 
@@ -63,17 +76,17 @@ struct authen_data *data;
  * Any strings pointed to by authen_data must come from the heap. They
  * will get freed by the caller.
  *
- * Return 0 if data->status is valid, otherwise 1 */
+ * Return 0 if data->status is valid, otherwise 1
+ */
+
+static int do_sendpass_fn TAC_ARGS((struct authen_data *data));
 
 static int
 do_sendpass_fn(data)
 struct authen_data *data;
 {
-    char *name;
-    char *p;
+    const char *name, *exp_date, *secret, *p;
     int expired;
-    char *exp_date;
-    char *secret;
 
     data->status = TAC_PLUS_AUTHEN_STATUS_FAIL;
 
@@ -159,8 +172,8 @@ struct authen_data *data;
            return(0);
        }
 
-       data->server_data = tac_strdup(p);
-       data->server_dlen = strlen(data->server_data);
+       data->server_data = (unsigned char *) tac_strdup(p);
+       data->server_dlen = strlen((char *) data->server_data);
        data->status = TAC_PLUS_AUTHEN_STATUS_PASS;
        if (expired == PW_EXPIRING) {
            data->server_msg = tac_strdup("Secret will expire soon");