diff options
author | venaas <venaas> | 2007-05-11 11:56:56 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2007-05-11 11:56:56 +0000 |
commit | 3bc969c6e614d44a11864714bb2aff74d5932bf5 (patch) | |
tree | 08b9b839c9384a6c34914be637f9535e8b81f0ab | |
parent | 8e9b9a8e79daae038c92d069de41349fe4070a43 (diff) |
more debug info
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@82 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r-- | radsecproxy.c | 17 |
1 files 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; |