Re: ENV variables in external scripts

2008-04-16 Thread rsg
Could unlang be used check Calling-station-Id for instance, from an SQL backend? 2008/4/10 Ivan Kalik [EMAIL PROTECTED]: You use unlang for that. Read man unlang. Ivan Kalik Kalik Informatika ISP Dana 10/4/2008, rsg [EMAIL PROTECTED] piše: Hi, After a brief review of the

Re: ENV variables in external scripts

2008-04-16 Thread rsg
Sorry, I guess it should be in the following format %{sql:SELECT ... However as of now lengthy query won't be supported?? 2008/4/16 rsg [EMAIL PROTECTED]: Could unlang be used check Calling-station-Id for instance, from an SQL backend? 2008/4/10 Ivan Kalik [EMAIL PROTECTED]: You

Re: ENV variables in external scripts

2008-04-16 Thread Ivan Kalik
No. Use it to bypass chap. http://www.freeradius.org/radiusd/man/unlang.html Ivan Kalik Kalik Informatika ISP Dana 16/4/2008, rsg [EMAIL PROTECTED] piše: Could unlang be used check Calling-station-Id for instance, from an SQL backend? 2008/4/10 Ivan Kalik [EMAIL PROTECTED]: You use unlang

Re: ENV variables in external scripts

2008-04-16 Thread rsg
Yes, that works well. Many thanks. In fact by changing the logic slightly you can achieve the required functionality fairly easily. e.g. changing the UserID/Password upon radius_request such that corresponding policies can be applied based on the modified UserName. rg. 2008/4/16 Ivan Kalik

Re: ENV variables in external scripts

2008-04-11 Thread A . L . M . Buxey
Hi, Hi, After a brief review of the logic, i managed to get it working. My apologies for the trouble and thank you for your time. rlm_perl related question once again: When performing credential based Auth, how could I simply fall-though to the next check when there isn't a match.

Re: ENV variables in external scripts

2008-04-10 Thread A . L . M . Buxey
Hi, My next query is when I tried to retrieve the CallerId from a Mysql DB using the same perl script with, - use Mysql; : : $status = $db-Mysql::query(SELECT IF(EXISTS(SELECT callerid FROM auth WHERE callerid='$RAD_REQUEST{/'Calling-Station-Id'/}'),'y','n')); your escape

Re: ENV variables in external scripts

2008-04-10 Thread rsg
Hi, I attempted setting it to a local variable as well. Result was the same. Thanks so much for your suggestions guidance. It's really appreciated. On Thu, Apr 10, 2008 at 1:02 PM, [EMAIL PROTECTED] wrote: Hi, My next query is when I tried to retrieve the CallerId from a Mysql DB

Re: ENV variables in external scripts

2008-04-10 Thread Ivan Kalik
$myvalue = $RAD_REQUEST{'Calling-Station-Id'}; # Print it or check in some other way $myquery = SELECT IF(EXISTS(SELECT callerid FROM auth WHERE callerid=' . $myvalue . '),'y','n'); # Now print or check in some other way the query to see if it is joined well $yourquery = SELECT IF(EXISTS(SELECT

Re: ENV variables in external scripts

2008-04-10 Thread rsg
Hi, After a brief review of the logic, i managed to get it working. My apologies for the trouble and thank you for your time. rlm_perl related question once again: When performing credential based Auth, how could I simply fall-though to the next check when there isn't a match. With

Re: ENV variables in external scripts

2008-04-10 Thread Ivan Kalik
You use unlang for that. Read man unlang. Ivan Kalik Kalik Informatika ISP Dana 10/4/2008, rsg [EMAIL PROTECTED] piše: Hi, After a brief review of the logic, i managed to get it working. My apologies for the trouble and thank you for your time. rlm_perl related question once again: When

Re: ENV variables in external scripts

2008-04-09 Thread rsg
Hi, Thanks a lot for the suggestion. I have a few more queries with regard to rlm_perl integration. When this module is used for Calling-Station-Id based auth, would it be independent of whether it is CHAP or PAP. I tried with ../users DEFAULT Auth-Type = perl Fall-Through = 1

Re: ENV variables in external scripts

2008-04-09 Thread Ivan Kalik
What freeradius version? I don't think that you can bypass chap in 1.1.x but it can be done in 2.0 with unlang. pap is listed last, so it will be bypassed in both versions. Ivan Kalik Kalik Informatika ISP Dana 9/4/2008, rsg [EMAIL PROTECTED] piše: Hi, Thanks a lot for the suggestion. I have

Re: ENV variables in external scripts

2008-04-09 Thread rsg
Hi, it's 1.1.7 If this cannot bypass CHAP, will have to do it using the same perl script then. My next query is when I tried to retrieve the CallerId from a Mysql DB using the same perl script with, - use Mysql; : : $status = $db-Mysql::query(SELECT IF(EXISTS(SELECT callerid FROM auth

RE: ENV variables in external scripts

2008-04-09 Thread Ivan Kalik
Subject: Re: ENV variables in external scripts Hi, it's 1.1.7 If this cannot bypass CHAP, will have to do it using the same perl script then. My next query is when I tried to retrieve the CallerId from a Mysql DB using the same perl script with, - use Mysql; : : $status = $db-Mysql

Re: ENV variables in external scripts

2008-04-08 Thread rsg
Subject: Re: ENV variables in external scripts Well.. What I meant was I actually would like to call an environmental variable as a variable in my simple perl script. Following Attributes as environment variables in executed programs in variables.txt for instance I

Re: ENV variables in external scripts

2008-04-08 Thread Ivan Kalik
With rlm_perl can external perl scripts be easily used as with Exec-Program-Wait ? Easier: http://wiki.freeradius.org/Rlm_perl Ivan Kalik Kalik Informatika ISP - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: ENV variables in external scripts

2008-04-05 Thread rsg
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of rsg Sent: Friday, March 07, 2008 10:37 AM To: FreeRadius users mailing list Subject: Re: ENV variables in external scripts Well.. What I meant was I actually would like to call an environmental

Re: ENV variables in external scripts

2008-04-05 Thread Ivan Kalik
: Friday, March 07, 2008 10:37 AM To: FreeRadius users mailing list Subject: Re: ENV variables in external scripts Well.. What I meant was I actually would like to call an environmental variable as a variable in my simple perl script. Following Attributes as environment

Re: ENV variables in external scripts

2008-04-04 Thread rsg
10:37 AM To: FreeRadius users mailing list Subject: Re: ENV variables in external scripts Well.. What I meant was I actually would like to call an environmental variable as a variable in my simple perl script. Following Attributes as environment variables in executed programs

Re: ENV variables in external scripts

2008-04-04 Thread Ivan Kalik
you'd have to use, $ENV{CALLING_STATION_ID}. Regards, Emilio -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of rsg Sent: Friday, March 07, 2008 10:37 AM To: FreeRadius users mailing list Subject: Re: ENV variables in external scripts Well

ENV variables in external scripts

2008-03-07 Thread rsg
Hi, I need to check an environmental varible with an external script. For example to capture Calling-Station-Id and check it in an external database using a perl script # ../users : . DEFAULT Auth-Type = None Exec-Program-Wait = /root/check.pl %i, Reply-Message := Valid

Re: ENV variables in external scripts

2008-03-07 Thread Alan DeKok
rsg wrote: I unsuccessfully attempted the options given by ../docs/variables.txt. Please help with the correct syntax. Q: I won't tell you what I did, or what happened when I did it, but I need to know why it doesn't work. A: Damned if I know. Alan DeKok. - List info/subscribe/unsubscribe?

Re: ENV variables in external scripts

2008-03-07 Thread rsg
Well.. What I meant was I actually would like to call an environmental variable as a variable in my simple perl script. Following Attributes as environment variables in executed programs in variables.txt for instance I tried the below. --- #!/usr/bin/perl -w

Re: ENV variables in external scripts

2008-03-07 Thread rsg
Here' what I see in my debug log. Access Reject because of exit status 255 in Exec-Program-Wait and as I said nothing corresponding to the read variable i.e Calling-Station-Id.

RE: ENV variables in external scripts

2008-03-07 Thread Escobar, Emilio
] On Behalf Of rsg Sent: Friday, March 07, 2008 10:37 AM To: FreeRadius users mailing list Subject: Re: ENV variables in external scripts Well.. What I meant was I actually would like to call an environmental variable as a variable in my simple perl script. Following Attributes as environment

Re: ENV variables in external scripts

2008-03-07 Thread Alan DeKok
rsg wrote: $Check = $CALLING_STATION_ID; Read the Perl documentation. print STDERR \t: $Check\n; Don't do this. Executed programs should print to STDOUT. They should NOT print to STDERR. $db = Mysql-connect(localhost,radius,root,); ... print STDERR \t: $chk\n; ... And the Sql check

Re: ENV variables in external scripts

2008-03-07 Thread rsg
variables in external scripts Well.. What I meant was I actually would like to call an environmental variable as a variable in my simple perl script. Following Attributes as environment variables in executed programs in variables.txt for instance I tried the below

Re: ENV variables in external scripts

2008-03-07 Thread rsg
On Fri, Mar 7, 2008 at 5:22 PM, Alan DeKok [EMAIL PROTECTED] wrote: Read the Perl documentation. Thanks for the advice. print STDERR \t: $Check\n; Don't do this. Executed programs should print to STDOUT. They should NOT print to STDERR. Would like to know why? Thanks in advance