X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=sendpass.c;h=9d8ab00e15e83b793523cf76f4924f7133d53094;hb=1a8e72c666b575c73e4d593d12631c4cc115aac9;hp=f7f0b3cde60a6b9457d771a304161087f8bb2ba3;hpb=a4d53c2fe3dc1952c7c7d8a4283545389ba5aa64;p=tac_plus.git diff --git a/sendpass.c b/sendpass.c index f7f0b3c..9d8ab00 100644 --- a/sendpass.c +++ b/sendpass.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1995-1998 by Cisco systems, Inc. Permission to use, copy, modify, and distribute this software for @@ -17,11 +17,24 @@ 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");