authorize an user using a multivalue ldap attribute

Ana Gallardo ana.gallardo.77 at gmail.com
Fri Oct 22 14:16:39 CEST 2010


Hello Alan, and thank you for your response.

  You can't really do that with "unlang".  I suggest using the perl module.
>


I flow your suggestion and write this:

# cat /etc/freeradius/perl/checkRelaciones.pm

use strict;
use vars qw(%RAD_REQUEST %RAD_REPLY %RAD_CHECK);
use Data::Dumper;

use constant    RLM_MODULE_REJECT=>    0;#  /* immediately reject the
request */
use constant    RLM_MODULE_OK=>        2;#  /* the module is OK, continue */

sub authorize {
   my $attr;
   my $valor;

   while (($attr,$valor)= each(%RAD_REPLY{'Relaciones'}){
      if ($valor =~ /^([0-9]{2})/) {
               return RLM_MODULE_OK;
      }
   }

   return RLM_MODULE_REJECT;
}


and I use this in authorize section:

authorize{
  ...
  files
  ...
  perl
  expiration
  ...
}

but, when I try to run freeradius in debug mode:
...
  perl {
    module = "/etc/freeradius/perl/checkRelaciones.pm"
    func_authorize = "authorize"
    func_authenticate = "authenticate"
    func_accounting = "accounting"
    func_preacct = "preacct"
    func_checksimul = "checksimul"
    func_detach = "detach"
    func_xlat = "xlat"
    func_pre_proxy = "pre_proxy"
    func_post_proxy = "post_proxy"
    func_post_auth = "post_auth"
    func_recv_coa = "recv_coa"
    func_send_coa = "send_coa"
  }

Can't load '/usr/lib/perl/5.10/auto/Data/Dumper/Dumper.so' for module
Data::Dumper: /usr/lib/perl/5.10/auto/Data/Dumper/Dumper.so: undefined
symbol: Perl_sv_cmp at /usr/lib/perl/5.10/XSLoader.pm line 64.
 at /usr/lib/perl/5.10/Data/Dumper.pm line 36


So, I think thah I need to upgrade or something like this.

Thank you again.

____________________

  Ana Gallardo Gómez
____________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20101022/d5fb14c6/attachment.html>


More information about the Freeradius-Users mailing list