From 3bc969c6e614d44a11864714bb2aff74d5932bf5 Mon Sep 17 00:00:00 2001 From: venaas Date: Fri, 11 May 2007 11:56:56 +0000 Subject: more debug info git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@82 e88ac4ed-0b26-0410-9574-a7f39faa03bf --- radsecproxy.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/radsecproxy.c b/radsecproxy.c index 5465865..54a0d33 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -1180,7 +1180,7 @@ void *clientrd(void *arg) { uint8_t attrvallen; struct sockaddr_storage fromsa; struct timeval lastconnecttry; - char tmp[255]; + char tmp[256]; for (;;) { lastconnecttry = server->lastconnecttry; @@ -1281,7 +1281,20 @@ void *clientrd(void *arg) { } } - /* log DBG_INFO that received access accept/reject and username attr from original request */ + if (*buf == RAD_Access_Accept || *buf == RAD_Access_Reject) { + attrval = attrget(server->requests[i].buf + 20, RADLEN(server->requests[i].buf) - 20, RAD_Attr_User_Name, &attrvallen); + /* we know the attribute exists */ + memcpy(tmp, attrval, attrvallen); + tmp[attrvallen] = '\0'; + switch (*buf) { + case RAD_Access_Accept: + debug(DBG_INFO, "Access Accept for %s", tmp); + break; + case RAD_Access_Reject: + debug(DBG_INFO, "Access Reject for %s", tmp); + break; + } + } /* once we set received = 1, requests[i] may be reused */ buf[1] = (char)server->requests[i].origid; -- cgit v1.1