From: Alan Buxey Date: Thu, 27 Mar 2014 11:03:24 +0000 (+0000) Subject: expose server version to slat and document X-Git-Tag: release_2_2_5~32^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F569%2Fhead;p=thirdparty%2Ffreeradius-server.git expose server version to slat and document --- diff --git a/doc/variables.rst b/doc/variables.rst index e128899e3b..88eaa93214 100644 --- a/doc/variables.rst +++ b/doc/variables.rst @@ -109,6 +109,8 @@ release. They also do NOT permit the use of conditional syntax +-----------+---------------------------+-----------------------+ |%u |User name |%{User-Name} | +-----------+---------------------------+-----------------------+ +|%v |Server Version | | ++-----------+---------------------------+-----------------------+ |%A |radacct_dir |%{config:radacctdir} | +-----------+---------------------------+-----------------------+ |%C |clientname | | diff --git a/src/main/xlat.c b/src/main/xlat.c index 9b97db0820..3b231a4bed 100644 --- a/src/main/xlat.c +++ b/src/main/xlat.c @@ -62,6 +62,8 @@ static const char * const internal_xlat[] = {"check", #endif static const int xlat_inst[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; /* up to 8 for regex */ +char const *radiusd_short_version = RADIUSD_VERSION_STRING; + /** * @brief Convert the value on a VALUE_PAIR to string */ @@ -1348,6 +1350,11 @@ int radius_xlat(char *out, int outlen, const char *fmt, q += valuepair2str(q,freespace,pairfind(request->packet->vps,PW_USER_NAME),PW_TYPE_STRING, func); p++; break; + case 'v': /* server version */ + strlcpy(q,radiusd_short_version,freespace); + q += strlen(q); + p++; + break; case 'A': /* radacct_dir */ strlcpy(q,radacct_dir,freespace); q += strlen(q);