rlm_perl still looses tags for tagged attributes even after upgrade to 2.1.6

Alexandr Kovalenko alexandr.kovalenko at gmail.com
Thu Aug 20 09:49:52 CEST 2009


Hello,

It has been stated in release notes for FR 2.1.6 that loosing of tags
for tagged attributes is fixed in rlm_perl in this version, but it is
not.

Look at the example below:

--------
$ radiusd -v | head -1
radiusd: FreeRADIUS Version 2.1.6, for host i386-portbld-freebsd7.2,
built on Aug 18 2009 at 12:31:54

$ perl -V
Summary of my perl5 (revision 5 version 8 subversion 9) configuration:
 Platform:
   osname=freebsd, osvers=7.2-release-p2, archname=i386-freebsd-64int
   uname='freebsd mile.office.tsu 7.2-release-p2 freebsd
7.2-release-p2 #0: fri jun 26 10:01:50 eest 2009
root at mile.office.tsu:usrobjusrsrcsysmile i386 '
   config_args='-sde -Dprefix=/usr/local
-Darchlib=/usr/local/lib/perl5/5.8.9/mach
-Dprivlib=/usr/local/lib/perl5/5.8.9
-Dman3dir=/usr/local/lib/perl5/5.8.9/perl/man/man3
-Dman1dir=/usr/local/man/man1
-Dsitearch=/usr/local/lib/perl5/site_perl/5.8.9/mach
-Dsitelib=/usr/local/lib/perl5/site_perl/5.8.9
-Dscriptdir=/usr/local/bin
-Dsiteman3dir=/usr/local/lib/perl5/5.8.9/man/man3
-Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv
-Uinstallusrbinperl -Dcc=cc -Duseshrplib -Dinc_version_list=none
-Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.9/BSDPAN"
-Doptimize=-O2 -fno-strict-aliasing -pipe -march=pentium4 -Ud_dosuid
-Ui_gdbm -Dusethreads=n -Dusemymalloc=y -Duse64bitint'
   hint=recommended, useposix=true, d_sigaction=define
   usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
   use64bitint=define use64bitall=undef uselongdouble=undef
   usemymalloc=y, bincompat5005=undef
 Compiler:
   cc='cc', ccflags
='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.9/BSDPAN" -DHAS_FPSETMASK
-DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe
-I/usr/local/include',
   optimize='-O2 -fno-strict-aliasing -pipe -march=pentium4',
   cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.9/BSDPAN"
-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe
-I/usr/local/include'
   ccversion='', gccversion='4.2.1 20070719  [FreeBSD]', gccosandvers=''
   intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
   d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
   ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
   alignbytes=4, prototype=define
 Linker and Libraries:
   ld='cc', ldflags =' -Wl,-E  -L/usr/local/lib'
   libpth=/usr/lib /usr/local/lib
   libs=-lgdbm -lm -lcrypt -lutil
   perllibs=-lm -lcrypt -lutil
   libc=, so=so, useshrplib=true, libperl=libperl.so
   gnulibc_version=''
 Dynamic Linking:
   dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='
-Wl,-R/usr/local/lib/perl5/5.8.9/mach/CORE'
   cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'


Characteristics of this binary (from libperl):
 Compile-time options: MYMALLOC PERL_MALLOC_WRAP USE_64_BIT_INT
                       USE_FAST_STDIO USE_LARGE_FILES USE_PERLIO
 Locally applied patches:
       defined-or
 Built under freebsd
 Compiled at Aug 18 2009 14:56:36
 @INC:
   /usr/local/lib/perl5/5.8.9/BSDPAN
   /usr/local/lib/perl5/site_perl/5.8.9/mach
   /usr/local/lib/perl5/site_perl/5.8.9
   /usr/local/lib/perl5/5.8.9/mach
   /usr/local/lib/perl5/5.8.9
   .
--------

Following code is used in sub authorize {} in perl module I'm trying to use
--------
  if (($RAD_REQUEST{'User-Name'} eq 'admin') and
($RAD_REQUEST{'User-Password'} eq 'test')) {
      $RAD_REPLY{'ERX-Service-Activate:1'} = "telesys";
      $RAD_REPLY{'ERX-Service-Statistics:1'} = "time-volume";
      $RAD_REPLY{'ERX-Qos-Parameters'}[0] = "internet_tr_value 2097152";
      $RAD_REPLY{'ERX-Qos-Parameters'}[1] = "internet_tr_value_in 2097152";
      $RAD_REPLY{'ERX-Service-Activate:2'} = "deny";
      $RAD_REPLY{'ERX-Qos-Profile-Name'} = "SP_Tele_Internet";
      $RAD_REPLY{'Framed-IP-Address'} = '10.0.112.2';
      $RAD_REPLY{'Framed-IP-Netmask'}= "255.255.255.255";
      $RAD_REPLY{'ERX-Primary-DNS'} = "1.2.3.4";
      $RAD_REPLY{'ERX-Secondary-DNS'} = "1.2.3.5";
      return RLM_MODULE_OK;
  };
--------

This gives following results:

# radtest admin test 10.3.1.252 12 huawei
Sending Access-Request of id 70 to 10.3.1.252 port 1812
      User-Name = "admin"
      User-Password = "test"
      NAS-IP-Address = 10.1.2.13
      NAS-Port = 12
rad_recv: Access-Accept packet from host 10.3.1.252 port 1812, id=70, length=188
      ERX-Qos-Parameters = "internet_tr_value 2097152"
      ERX-Qos-Parameters = "internet_tr_value_in 2097152"
      ERX-Service-Activate:0 = "deny"
      ERX-Service-Activate:0 = "telesys"
      ERX-Qos-Profile-Name = "SP_Tele_Internet"
      ERX-Service-Statistics:1 = time-volume
      ERX-Primary-Dns = 1.2.3.4
      ERX-Secondary-Dns = 1.2.3.5
      Framed-IP-Address = 10.0.112.2
      Framed-IP-Netmask = 255.255.255.255


--------
Output from radiusd -X:

rad_recv: Access-Request packet from host 10.3.1.252 port 52845,
id=70, length=57
      User-Name = "admin"
      User-Password = "test"
      NAS-IP-Address = 10.1.2.13
      NAS-Port = 12
server radoss {
+- entering group authorize {...}
++[preprocess] returns ok
++[control] returns ok
rlm_perl: $VAR1 = {};
rlm_perl: defined
rlm_perl: Added pair User-Name = admin
rlm_perl: Added pair User-Password = test
rlm_perl: Added pair NAS-Port = 12
rlm_perl: Added pair NAS-IP-Address = 10.1.2.13
rlm_perl: Added pair ERX-Qos-Profile-Name = SP_Tele_Internet
rlm_perl: Added pair ERX-Service-Activate:2 = deny
rlm_perl: Added pair ERX-Qos-Parameters = internet_tr_value 2097152
rlm_perl: Added pair ERX-Qos-Parameters = internet_tr_value_in 2097152
rlm_perl: Added pair ERX-Service-Statistics:1 = time-volume
rlm_perl: Added pair ERX-Secondary-DNS = 1.2.3.5
rlm_perl: Added pair Framed-IP-Address = 10.0.112.2
rlm_perl: Added pair Framed-IP-Netmask = 255.255.255.255
rlm_perl: Added pair ERX-Service-Activate:1 = telesys
rlm_perl: Added pair ERX-Primary-DNS = 1.2.3.4
rlm_perl: Added pair Auth-Type = Perl
++[perl] returns ok
Found Auth-Type = Perl
+- entering group Perl {...}
rlm_perl: Added pair User-Name = admin
rlm_perl: Added pair User-Password = test
rlm_perl: Added pair NAS-IP-Address = 10.1.2.13
rlm_perl: Added pair NAS-Port = 12
rlm_perl: Added pair ERX-Qos-Parameters = internet_tr_value 2097152
rlm_perl: Added pair ERX-Qos-Parameters = internet_tr_value_in 2097152
rlm_perl: Added pair ERX-Service-Activate = deny
rlm_perl: Added pair ERX-Service-Activate = telesys
rlm_perl: Added pair ERX-Qos-Profile-Name = SP_Tele_Internet
rlm_perl: Added pair ERX-Service-Statistics:1 = time-volume
rlm_perl: Added pair ERX-Primary-Dns = 1.2.3.4
rlm_perl: Added pair ERX-Secondary-Dns = 1.2.3.5
rlm_perl: Added pair Framed-IP-Address = 10.0.112.2
rlm_perl: Added pair Framed-IP-Netmask = 255.255.255.255
rlm_perl: Added pair Auth-Type = Perl
++[perl] returns ok
+- entering group post-auth {...}
++[exec] returns noop
} # server radoss
Sending Access-Accept of id 70 to 10.3.1.252 port 52845
      ERX-Qos-Parameters += "internet_tr_value 2097152"
      ERX-Qos-Parameters += "internet_tr_value_in 2097152"
      ERX-Service-Activate:0 += "deny"
      ERX-Service-Activate:0 += "telesys"
      ERX-Qos-Profile-Name = "SP_Tele_Internet"
      ERX-Service-Statistics:1 = time-volume
      ERX-Primary-Dns = 1.2.3.4
      ERX-Secondary-Dns = 1.2.3.5
      Framed-IP-Address = 10.0.112.2
      Framed-IP-Netmask = 255.255.255.255
Finished request 0.
Going to the next request
Waking up in 4.9 seconds.
Cleaning up request 0 ID 70 with timestamp +4
Ready to process requests.

-- 
Alexandr Kovalenko
http://uafug.org.ua/



More information about the Freeradius-Users mailing list