summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2007-09-27 14:47:07 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2007-09-27 14:47:07 +0000
commitc6b62c81054ca425390d383c436bed44495f6d76 (patch)
tree4d47440c2bfdc0d4ae621ddddb7efdec3f950a80
parentc63ea11e0d2ae26d27b2bc4848d8a66730ba1ef1 (diff)
now only send reject when rejectmessage specified. empty message means rejet is sent without rejectmessage
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@171 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--radsecproxy.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index dfe8141..0da8503 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1299,7 +1299,7 @@ void respondreject(struct request *rq, char *message) {
unsigned char *resp;
int len = 20;
- if (message)
+ if (message && *message)
len += 2 + strlen(message);
resp = malloc(len);
@@ -1310,7 +1310,7 @@ void respondreject(struct request *rq, char *message) {
memcpy(resp, rq->buf, 20);
resp[0] = RAD_Access_Reject;
*(uint16_t *)(resp + 2) = htons(len);
- if (message) {
+ if (message && *message) {
resp[20] = RAD_Attr_Reply_Message;
resp[21] = len - 20;
memcpy(resp + 22, message, len - 22);
@@ -1416,8 +1416,10 @@ void radsrv(struct request *rq) {
}
if (!to) {
- debug(DBG_INFO, "radsrv: sending reject to %s for %s", rq->from->conf->host, username);
- respondreject(rq, realm->message);
+ if (realm->message) {
+ debug(DBG_INFO, "radsrv: sending reject to %s for %s", rq->from->conf->host, username);
+ respondreject(rq, realm->message);
+ }
free(buf);
return;
}