aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-12-13 17:55:44 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-12-13 17:55:44 +0000
commitf821a57dd06e8f2da0cf099548949ef1398a58ec (patch)
tree0fcb889335e8a4c46351617023ca0d3f980398df
parentd8764447afda5a02e3c44c504c80c0e28b9af77d (diff)
downloadradius-f821a57dd06e8f2da0cf099548949ef1398a58ec.tar.gz
radius-f821a57dd06e8f2da0cf099548949ef1398a58ec.tar.bz2
* bootstrap.conf: Do not use --source-base in
gnulib_tool_option_extras, to avoid triggering gnulib bootstrap bug. * configure.ac, NEWS: Version 1.15.90. * Makefile.am (distuninstallcheck_listfiles): Fix rule. * include/radiusd.h (struct request.srv_addr): New field. (struct request_class.decode): Change signature. (request_create,radius_auth_req_decode) (radius_acct_req_decode,snmp_req_decode): Change signature. * raddb/dict/standard (GNU-Server-Address,GNU-Server-Port): New attributes. * radiusd/radius.c (radius_auth_req_decode) (radius_acct_req_decode): Change signature. Add GNU-Server-Address, GNU-Server-Port to the request. * radiusd/radiusd.c (udp_input_handler): Update call to request_create. * radiusd/request.c (request_create): Change signature. Update call to decode. * radiusd/rpp.c (rpp_comparator): Fix declaration. (struct rpp_request.srv_addr): New member. (struct rpp_request.addr): Rename to clt_addr. (rpp_request_handler): update call to request_create. * radiusd/snmpserv.c (snmp_req_decode): Change signature. * radiusd/sql.c: Include radscm.h conditionally. * tests/scheme-acct.at: Ignore GNU-Server-Address and GNU-Server-Port attributes.
-rw-r--r--ChangeLog29
-rw-r--r--Makefile.am2
-rw-r--r--NEWS23
-rw-r--r--bootstrap.conf8
-rw-r--r--configure.ac2
-rw-r--r--include/radiusd.h17
-rw-r--r--m4/.cvsignore3
-rw-r--r--po/.cvsignore2
-rw-r--r--raddb/dict/standard5
-rw-r--r--radiusd/radius.c33
-rw-r--r--radiusd/radiusd.c1
-rw-r--r--radiusd/request.c9
-rw-r--r--radiusd/rpp.c21
-rw-r--r--radiusd/snmpserv.c7
-rw-r--r--radiusd/sql.c2
-rw-r--r--tests/scheme-acct.at2
16 files changed, 128 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index a5984c5f..9db942d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2007-12-13 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * bootstrap.conf: Do not use --source-base in
+ gnulib_tool_option_extras, to avoid triggering gnulib bootstrap
+ bug.
+ * configure.ac, NEWS: Version 1.15.90.
+ * Makefile.am (distuninstallcheck_listfiles): Fix rule.
+ * include/radiusd.h (struct request.srv_addr): New field.
+ (struct request_class.decode): Change signature.
+ (request_create,radius_auth_req_decode)
+ (radius_acct_req_decode,snmp_req_decode): Change signature.
+ * raddb/dict/standard (GNU-Server-Address,GNU-Server-Port): New
+ attributes.
+ * radiusd/radius.c (radius_auth_req_decode)
+ (radius_acct_req_decode): Change signature. Add
+ GNU-Server-Address, GNU-Server-Port to the request.
+ * radiusd/radiusd.c (udp_input_handler): Update call to
+ request_create.
+ * radiusd/request.c (request_create): Change signature. Update
+ call to decode.
+ * radiusd/rpp.c (rpp_comparator): Fix declaration.
+ (struct rpp_request.srv_addr): New member.
+ (struct rpp_request.addr): Rename to clt_addr.
+ (rpp_request_handler): update call to request_create.
+ * radiusd/snmpserv.c (snmp_req_decode): Change signature.
+ * radiusd/sql.c: Include radscm.h conditionally.
+ * tests/scheme-acct.at: Ignore GNU-Server-Address and
+ GNU-Server-Port attributes.
+
2007-11-12 Sergey Poznyakoff <gray@gnu.org.ua>
* radiusd/sql.c (rad_sql_mlc_close): Pass NAS-IP-Address
diff --git a/Makefile.am b/Makefile.am
index 86b96682..90d5d9c1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,7 +34,7 @@ update-dictionary:
# We never remove the contents of configuration directory and the
# info directory index
distuninstallcheck_listfiles = \
- find . -type f | while read NAME; do expr $$NAME : '\..*/etc/raddb' >/dev/null || expr $$NAME : '\..*/info/dir' >/dev/null || echo $$NAME ; done
+ find $(prefix) -type f -not -path '$(sysconfdir)/raddb/*'
if MAINTAINER_MODE
MAINTAINERCLEANFILES=core *~ err out
diff --git a/NEWS b/NEWS
index e64cdb8b..e2026390 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,30 @@
-GNU Radius NEWS -- history of user-visible changes. 2007-06-29
+GNU Radius NEWS -- history of user-visible changes. 2007-12-13
Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
See the end of file for copying conditions.
Please send radius bug reports to <bug-gnu-radius@gnu.org>
+Version 1.5.90
+
+
+* New attributes
+
+** GNU-Server-Address
+
+Holds IP address of the RADIUS server that recieved the
+request. Notice, that the value of this attribute is "0.0.0.0" if
+there are no `listen' statement in your `raddb/config'.
+
+** GNU-Server-Port
+
+Holds UDP port number of the RADIUS server that recieved the request.
+
+* Guile support requires Gule version 1.8 or later.
+
+* Bugfixes
+** Pass NAS-IP-Address to mlc_stop_query
+
+
Version 1.5 - Sergey Poznyakoff, 2007-06-29:
* GPLv3
diff --git a/bootstrap.conf b/bootstrap.conf
index fc2059e2..43c67c24 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -17,9 +17,9 @@
# along with GNU Radius; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+gnulib_mk=Makefile.am
gnulib_name=libgnu
-gnulib_tool_option_extras=" --source-base=gnu --avoid=dirname"
-
+source_base=gnu
build_aux=scripts
gnulib_modules="obstack
@@ -31,6 +31,10 @@ gnulib_modules="obstack
strerror
strcase"
+avoided_gnulib_modules='
+ --avoid=dirname
+'
+
# Additional xgettext options to use. Use "\\\newline" to break lines.
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
--flag=_:1:pass-c-format\\\
diff --git a/configure.ac b/configure.ac
index 16eaeab8..fd757471 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@
AC_PREREQ(2.59)
AC_REVISION($Revision$)
-AC_INIT([GNU Radius], [1.5], [bug-gnu-radius@gnu.org])
+AC_INIT([GNU Radius], [1.5.90], [bug-gnu-radius@gnu.org])
AC_CONFIG_SRCDIR(radiusd/radiusd.c)
AC_CONFIG_AUX_DIR([scripts])
AC_CONFIG_LIBOBJ_DIR([gnu])
diff --git a/include/radiusd.h b/include/radiusd.h
index dd3d1a9e..6045bdc8 100644
--- a/include/radiusd.h
+++ b/include/radiusd.h
@@ -112,6 +112,7 @@ struct request {
socket */
size_t rawsize; /* Size of the data */
int fd; /* socket the request came from */
+ struct sockaddr_in srv_addr; /* Server address */
struct sockaddr_in addr; /* Remote party address */
REQUEST *orig; /* Original request. For proxy */
};
@@ -123,7 +124,8 @@ typedef struct request_class {
int max_requests; /* Max.number of pending requests of this type */
int ttl; /* Request time-to-live */
int cleanup_delay; /* Delay before cleaning the completed request */
- int (*decode)(struct sockaddr_in *sa,
+ int (*decode)(const struct sockaddr_in *srv_sa,
+ const struct sockaddr_in *clt_sa,
void *input, size_t inputsize, void **output);
int (*respond)(REQUEST *r); /* Handler function */
void (*xmit)(REQUEST *r); /* Retransmit function */
@@ -387,7 +389,9 @@ int rpp_update(void *data, size_t size);
pid_t rpp_check_pid(pid_t pid);
/* request.c */
-REQUEST *request_create(int type, int fd, struct sockaddr_in *sa,
+REQUEST *request_create(int type, int fd,
+ const struct sockaddr_in *srv_sa,
+ const struct sockaddr_in *clt_sa,
u_char *buf, size_t bufsize);
void request_free(REQUEST *req);
int request_respond(REQUEST *req);
@@ -481,9 +485,11 @@ void radius_send_reply(int, radiusd_request_t *, grad_avp_t *, char *, int);
void radius_send_challenge(radiusd_request_t *radreq, char *msg, char *state, int fd);
int radius_verify_digest(REQUEST *req);
-int radius_auth_req_decode(struct sockaddr_in *sa,
+int radius_auth_req_decode(const struct sockaddr_in *srv_sa,
+ const struct sockaddr_in *clt_sa,
void *input, size_t inputsize, void **output);
-int radius_acct_req_decode(struct sockaddr_in *sa,
+int radius_acct_req_decode(const struct sockaddr_in *srv_sa,
+ const struct sockaddr_in *clt_sa,
void *input, size_t inputsize, void **output);
int radius_req_cmp(void *a, void *b);
void radius_req_free(void *req);
@@ -625,7 +631,8 @@ int stat_get_next_port_no(grad_nas_t *nas, int port_no);
#endif
/* snmpserver.c */
-int snmp_req_decode(struct sockaddr_in *sa,
+int snmp_req_decode(const struct sockaddr_in *srv_sa,
+ const struct sockaddr_in *clt_sa,
void *input, size_t inputsize, void **output);
int snmp_req_cmp(void *ap, void *bp);
void snmp_req_free(void *ptr);
diff --git a/m4/.cvsignore b/m4/.cvsignore
index 9feb2a19..44d2630e 100644
--- a/m4/.cvsignore
+++ b/m4/.cvsignore
@@ -51,6 +51,7 @@ ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
+malloc.m4
mbchar.m4
mbiter.m4
mbrtowc.m4
@@ -62,6 +63,7 @@ onceonly_2_57.m4
po.m4
printf-posix.m4
progtest.m4
+realloc.m4
regex.m4
signed.m4
size_max.m4
@@ -76,6 +78,7 @@ strcase.m4
strchrnul.m4
strerror.m4
string_h.m4
+strings_h.m4
strndup.m4
strnlen.m4
sysexits.m4
diff --git a/po/.cvsignore b/po/.cvsignore
index 51fcb31e..11170dd2 100644
--- a/po/.cvsignore
+++ b/po/.cvsignore
@@ -15,7 +15,9 @@ Rules-quot
boldquot.sed
en@boldquot.header
en@quot.header
+insert-header.sed
insert-header.sin
quot.sed
+remove-potcdate.sed
remove-potcdate.sin
stamp-po
diff --git a/raddb/dict/standard b/raddb/dict/standard
index c8957f28..b118549c 100644
--- a/raddb/dict/standard
+++ b/raddb/dict/standard
@@ -157,6 +157,8 @@ ATTRIBUTE Orig-NAS-Port-Id 2105 integer [L--R-R]
ATTRIBUTE Orig-Acct-Session-Id 2144 integer [L--R-R]
ATTRIBUTE Password-Expire-Days 2145 integer [------]
+ATTRIBUTE GNU-Server-Address 2146 ipaddr [L-LRLR]=
+ATTRIBUTE GNU-Server-Port 2147 integer [L-LRLR]=
#
# Non-Protocol Attributes
@@ -188,9 +190,6 @@ VALUE Service-Type NAS-Prompt-User 7
VALUE Service-Type Authenticate-Only 8
VALUE Service-Type Call-Check 10
-# GNU Radius Extension
-VALUE Service-Type RADIUS-Administrative-User 20
-
# Framed Protocols
VALUE Framed-Protocol PPP 1
diff --git a/radiusd/radius.c b/radiusd/radius.c
index e6d884e9..515d1f37 100644
--- a/radiusd/radius.c
+++ b/radiusd/radius.c
@@ -155,8 +155,20 @@ radius_verify_digest(REQUEST *req)
/* *********************** Radius Protocol Support ************************* */
+static void
+add_server_address(grad_request_t *req, const struct sockaddr_in *sa)
+{
+ grad_avl_add_pair(&req->avlist,
+ grad_avp_create_integer(DA_GNU_SERVER_ADDRESS,
+ ntohl(sa->sin_addr.s_addr)));
+ grad_avl_add_pair(&req->avlist,
+ grad_avp_create_integer(DA_GNU_SERVER_PORT,
+ ntohs(sa->sin_port)));
+}
+
int
-radius_auth_req_decode(struct sockaddr_in *sa,
+radius_auth_req_decode(const struct sockaddr_in *srv_sa,
+ const struct sockaddr_in *clt_sa,
void *input, size_t inputsize, void **output)
{
grad_request_t *greq;
@@ -165,12 +177,12 @@ radius_auth_req_decode(struct sockaddr_in *sa,
log_open(L_AUTH);
if (suspend_flag) {
- stat_inc(auth, ntohl(sa->sin_addr.s_addr), num_dropped);
+ stat_inc(auth, ntohl(clt_sa->sin_addr.s_addr), num_dropped);
return 1;
}
- greq = grad_decode_pdu(ntohl(sa->sin_addr.s_addr),
- ntohs(sa->sin_port),
+ greq = grad_decode_pdu(ntohl(clt_sa->sin_addr.s_addr),
+ ntohs(clt_sa->sin_port),
input,
inputsize);
if (!greq)
@@ -183,6 +195,8 @@ radius_auth_req_decode(struct sockaddr_in *sa,
}
radreq = radiusd_request_alloc(greq);
+
+ add_server_address (radreq->request, srv_sa);
/* RFC 2865 p. 2.2:
The random challenge can either be included in the
@@ -203,7 +217,8 @@ radius_auth_req_decode(struct sockaddr_in *sa,
}
int
-radius_acct_req_decode(struct sockaddr_in *sa,
+radius_acct_req_decode(const struct sockaddr_in *srv_sa,
+ const struct sockaddr_in *clt_sa,
void *input, size_t inputsize, void **output)
{
grad_request_t *greq;
@@ -211,12 +226,12 @@ radius_acct_req_decode(struct sockaddr_in *sa,
log_open(L_ACCT);
if (suspend_flag) {
- stat_inc(acct, ntohl(sa->sin_addr.s_addr), num_dropped);
+ stat_inc(acct, ntohl(clt_sa->sin_addr.s_addr), num_dropped);
return 1;
}
- greq = grad_decode_pdu(ntohl(sa->sin_addr.s_addr),
- ntohs(sa->sin_port),
+ greq = grad_decode_pdu(ntohl(clt_sa->sin_addr.s_addr),
+ ntohs(clt_sa->sin_port),
input,
inputsize);
if (!greq)
@@ -228,7 +243,9 @@ radius_acct_req_decode(struct sockaddr_in *sa,
return 1;
}
+ add_server_address (greq, srv_sa);
*output = radiusd_request_alloc(greq);
+
return 0;
}
diff --git a/radiusd/radiusd.c b/radiusd/radiusd.c
index 87a23ae8..e3a1dc28 100644
--- a/radiusd/radiusd.c
+++ b/radiusd/radiusd.c
@@ -1084,6 +1084,7 @@ udp_input_handler(int fd, void *data)
else {
REQUEST *req = request_create(sd->type,
fd,
+ &sd->addr,
(struct sockaddr_in*)&sa,
recv_buffer, size);
diff --git a/radiusd/request.c b/radiusd/request.c
index fc838e77..b1084ada 100644
--- a/radiusd/request.c
+++ b/radiusd/request.c
@@ -71,19 +71,22 @@ static grad_list_t *request_list; /* List of REQUEST structures */
/* ************************* General-purpose functions ********************* */
REQUEST *
-request_create(int type, int fd, struct sockaddr_in *sa,
+request_create(int type, int fd,
+ const struct sockaddr_in *srv_sa,
+ const struct sockaddr_in *clt_sa,
u_char *buf, size_t bufsize)
{
void *data;
REQUEST *req;
- if (request_class[type].decode(sa, buf, bufsize, &data))
+ if (request_class[type].decode(srv_sa, clt_sa, buf, bufsize, &data))
return NULL;
req = grad_emalloc(sizeof *req);
req->data = data;
time(&req->timestamp);
req->type = type;
- req->addr = *sa;
+ req->srv_addr = *srv_sa;
+ req->addr = *clt_sa;
req->rawdata = grad_emalloc(bufsize);
memcpy(req->rawdata, buf, bufsize);
req->rawsize = bufsize;
diff --git a/radiusd/rpp.c b/radiusd/rpp.c
index e46409e7..35209a8e 100644
--- a/radiusd/rpp.c
+++ b/radiusd/rpp.c
@@ -337,10 +337,10 @@ rpp_lookup_ready(int (*proc_main)(void *), void *data)
/* Find the rpp_proc_t with a given PID */
static int
-rpp_comparator(void *item, void *data)
+rpp_comparator(const void *item, const void *data)
{
- rpp_proc_t *p = item;
- pid_t *pid = data;
+ const rpp_proc_t *p = item;
+ const pid_t *pid = data;
return p->pid != *pid;
}
@@ -529,10 +529,11 @@ rpp_count()
struct rpp_request {
- int type; /* Request type */
- struct sockaddr_in addr; /* Sender address */
- int fd; /* Source descriptor */
- size_t size; /* Size of the raw data */
+ int type; /* Request type */
+ struct sockaddr_in srv_addr; /* Server address */
+ struct sockaddr_in clt_addr; /* Sender address */
+ int fd; /* Source descriptor */
+ size_t size; /* Size of the raw data */
/* Raw data follow */
};
@@ -563,7 +564,8 @@ rpp_forward_request(REQUEST *req)
GRAD_DEBUG1(1, "sending request to %d", p->pid);
frq.type = req->type;
- frq.addr = req->addr;
+ frq.srv_addr = req->srv_addr;
+ frq.clt_addr = req->addr;
frq.fd = req->fd;
frq.size = req->rawsize;
@@ -676,7 +678,8 @@ rpp_request_handler(void *arg ARG_UNUSED)
radiusd_exit0();
}
- req = request_create(frq.type, frq.fd, &frq.addr,
+ req = request_create(frq.type, frq.fd,
+ &frq.srv_addr, &frq.clt_addr,
data, frq.size);
req->status = RS_COMPLETED;
diff --git a/radiusd/snmpserv.c b/radiusd/snmpserv.c
index 1c244b77..9e38577f 100644
--- a/radiusd/snmpserv.c
+++ b/radiusd/snmpserv.c
@@ -2711,13 +2711,14 @@ snmp_decode(SNMP_REQ *req, u_char *buf, size_t len)
}
int
-snmp_req_decode(struct sockaddr_in *sa,
- void *input, size_t inputsize, void **output)
+snmp_req_decode(const struct sockaddr_in *srv_sa,
+ const struct sockaddr_in *clt_sa,
+ void *input, size_t inputsize, void **output)
{
SNMP_REQ *req;
req = grad_emalloc(sizeof *req);
- req->addr = *sa;
+ req->addr = *clt_sa;
if (snmp_decode(req, input, inputsize)) {
grad_free(req);
return 1;
diff --git a/radiusd/sql.c b/radiusd/sql.c
index dd997a5c..c6fe4c59 100644
--- a/radiusd/sql.c
+++ b/radiusd/sql.c
@@ -32,8 +32,8 @@
#ifdef USE_SERVER_GUILE
# include <libguile.h>
+# include <radscm.h>
#endif
-#include <radscm.h>
#if defined(USE_SQL)
diff --git a/tests/scheme-acct.at b/tests/scheme-acct.at
index f942d3ee..dc55e198 100644
--- a/tests/scheme-acct.at
+++ b/tests/scheme-acct.at
@@ -28,7 +28,7 @@ RA_PREREQ([USE_SERVER_GUILE],
Acct-Status-Type = Start \
Acct-Session-Id = "0001"
expect Accounting-Response])
- AT_CHECK([cat $BUILDDIR/raddb/acct/scheme],
+ AT_CHECK([sed '/GNU-Server-Address/d;/GNU-Server-Port/d' $BUILDDIR/raddb/acct/scheme],
[0],
[User-Name=scheme
NAS-IP-Address=2130706433

Return to:

Send suggestions and report system problems to the System administrator.