problem with perl...
Tyller D
tyllerd at gmail.com
Thu Aug 25 14:42:30 CEST 2011
Hi
perl3.pl is my script
It looks like this
#!/bin/perl
# PERL MODULES WE WILL BE USING
use lib "/usr/lib64/perl5/auto/DBI/";
use DBI;
use DBD::mysql;
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_FAIL=> 1;# /* module failed, don't
reply */
use constant RLM_MODULE_OK=> 2;# /* the module is OK,
continue */
use constant RLM_MODULE_HANDLED=> 3;# /* the module handled the
request, so stop. */
use constant RLM_MODULE_INVALID=> 4;# /* the module considers
the request invalid. */
use constant RLM_MODULE_USERLOCK=> 5;# /* reject the request
(user is locked out) */
use constant RLM_MODULE_NOTFOUND=> 6;# /* user not found */
use constant RLM_MODULE_NOOP=> 7;# /* module succeeded
without doing anything */
use constant RLM_MODULE_UPDATED=> 8;# /* OK (pairs modified) */
use constant RLM_MODULE_NUMCODES=> 9;# /* How many return codes
there are */
$database="radius";
$user="root";
$pw="";
$dsn = "dbi:mysql:$database:localhost:3306";
$connect = DBI->connect($dsn, $user, $pw);
$myquery=$connect->prepare("SELECT username from admin");
$myquery->execute();
$myquery->bind_columns(undef, \$username);
while($myquery->fetch()) {
print "$username";
}
Its not the one I normally use, but its just for testing. and it works. I
get the username value returned to the screen if I run the script
On Thu, Aug 25, 2011 at 1:36 PM, Fajar A. Nugraha <list at fajar.net> wrote:
> On Thu, Aug 25, 2011 at 4:21 PM, Tyller D <tyllerd at gmail.com> wrote:
> >
> >> Hi
> >>
> >> Im trying to run freeradius, using rlm_perl, and centos 6.
> >>
> >> after installing ( yum install freeradius freeradius-mysql
> freeradius-perl
> >> freeradius-utils ). when I and start free radius I fails with this error
> >>
> >> Can't load '/usr/local/lib64/perl5/auto/DBI/DBI.so' for module DBI:
> >> /usr/local/lib64/perl5/auto/DBI/DBI.so: undefined symbol: PL_memory_wrap
> at
> >> /usr/lib64/perl5/DynaLoader.pm line 200.
> >> at /usr/local/lib64/perl5/DBI.pm line 268
> >> BEGIN failed--compilation aborted at /usr/local/lib64/perl5/DBI.pm line
> >> 268.
>
> why /usr/local? did you install DBI manually? Why not use perl-DBI rpm?
>
>
I'm not sure why /usr/local. but i originally started freeradius got the
error then tried to install via cpan
Package perl-DBD-MySQL-4.013-3.el6.x86_64 already installed and latest
version
Package perl-DBI-1.609-4.el6.x86_64 already installed and latest version
> >> Compilation failed in require at /etc/raddb/perl3.pl line 6.
> >> BEGIN failed--compilation aborted at /etc/raddb/perl3.pl line 6.
>
> What's in per3.pl? Does it work without freeradius (e.g. create a test
> script which uses functions on perl3.pl that is used by freeradius,
> like authenticate and friends)
>
> --
> Fajar
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
Like I said though, it runs fine outside of freeradius - its just when
freeradius tries to run it, it fails
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20110825/28aa9059/attachment.html>
More information about the Freeradius-Users
mailing list