Re: Freeradius+MySql (Authorization Query) - regexp

2003-12-22 Thread Alan DeKok
=?iso-8859-1?q?Kiran?= <[EMAIL PROTECTED]> wrote:
> I am using the following query for authorization and I
> am getting the error 1064 from MySql (PARSE ERROR).
> But when I am giving the same query replacing the
> variables with values, I am getting the output. Can
> someone explain me why.

  Look at the SQL debug log file.  It will have the queries with the
variables replaced by values.

> "(select id,UserName,Attribute,Value,op from
> ${authreply_table} where username='%{SQL-User-Name}')
> union (select id,UserName, Attribute,
> concat('h323-credit-time=',round(substring(value,20)/(tas_rate+charge))*60)
> Value,op from ${authreply_table}, pb_tariffs,surcharge
> where \"%{Called-Station-Id}\" regexp
> concat("^"...


  A double quote inside of a double-quoted string?

> I am getting the error after adding 'regexp' to the
> query.

  Then what you added is the source of the problem.

  Alan DeKok.

   

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Freeradius+MySql (Authorization Query) - regexp

2003-12-22 Thread Kiran
Hi 

I am using the following query for authorization and I
am getting the error 1064 from MySql (PARSE ERROR).
But when I am giving the same query replacing the
variables with values, I am getting the output. Can
someone explain me why.

"(select id,UserName,Attribute,Value,op from
${authreply_table} where username='%{SQL-User-Name}')
union (select id,UserName, Attribute,
concat('h323-credit-time=',round(substring(value,20)/(tas_rate+charge))*60)
Value,op from ${authreply_table}, pb_tariffs,surcharge
where \"%{Called-Station-Id}\" regexp
concat("^",de_prefix) and value like
'h323-credit-amount=%' and username='%{SQL-User-Name}'
and dnis='%{Calling-Station-Id}' order by de_prefix
desc limit 1)"


I am getting the error after adding 'regexp' to the
query.

Thanks,
Kiran


Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: mysql authorization

2003-02-28 Thread Rick Evans
If you remark out the 'Auth-Type' all together in the 'users' file, then
freeradius will begin to use the 'Auth-Type' specified in MySQL.
That has been my experience at least.

Rick E.

- Original Message -
From: "Alan DeKok" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 28, 2003 5:33 AM
Subject: Re: mysql authorization


> "John E Murphy" <[EMAIL PROTECTED]> wrote:
> > I am trying to use mysql to authorize users.  It seems that they are
> > authorized but never get through because the system looks at the
/etc/passwd
> > file.  Attached is the -X output.
>
>   So configure the server to use a different Auth-Type.  It comes
> configured to use 'Auth-Type := System', and it looks like you didn't
> change that.
>
>   Alan DeKok.
>
> -
> List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: mysql authorization

2003-02-28 Thread Alan DeKok
"John E Murphy" <[EMAIL PROTECTED]> wrote:
> I am trying to use mysql to authorize users.  It seems that they are
> authorized but never get through because the system looks at the /etc/passwd
> file.  Attached is the -X output.

  So configure the server to use a different Auth-Type.  It comes
configured to use 'Auth-Type := System', and it looks like you didn't
change that.

  Alan DeKok.

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


mysql authorization

2003-02-28 Thread John E Murphy
I am trying to use mysql to authorize users.  It seems that they are
authorized but never get through because the system looks at the /etc/passwd
file.  Attached is the -X output.

rad_recv: Access-Request packet from host 192.168.1.100:1880, id=17,
length=46
User-Name = "fred33"
User-Password = "fred33"
modcall: entering group authorize
  modcall[authorize]: module "preprocess" returns ok
rlm_chap: Could not find proper Chap-Password attribute in request
  modcall[authorize]: module "chap" returns noop
  modcall[authorize]: module "mschap" returns notfound
rlm_realm: No '@' in User-Name = "fred33", looking up realm NULL
rlm_realm: No such realm NULL
  modcall[authorize]: module "suffix" returns noop
users: Matched DEFAULT at 152
  modcall[authorize]: module "files" returns ok
radius_xlat:  'fred33'
rlm_sql (sql): sql_set_user escaped user --> 'fred33'
radius_xlat:  'SELECT id,UserName,Attribute,Value,op FROM radcheck WHERE
Username = 'fred33' ORDER BY id'
rlm_sql (sql): Reserving sql socket id: 2
radius_xlat:  'SELECT
radgroupcheck.id,radgroupcheck.GroupName,radgroupcheck.Attribute,radgroupche
ck.Value,radgroupcheck.op  FROM radgroupcheck,usergroup WHERE
usergroup.Username = 'fred33' AND usergroup.GroupName =
radgroupcheck.GroupName ORDER BY radgroupcheck.id'
radius_xlat:  'SELECT id,UserName,Attribute,Value,op FROM radreply WHERE
Username = 'fred33' ORDER BY id'
radius_xlat:  'SELECT
radgroupreply.id,radgroupreply.GroupName,radgroupreply.Attribute,radgrouprep
ly.Value,radgroupreply.op  FROM radgroupreply,usergroup WHERE
usergroup.Username = 'fred33' AND usergroup.GroupName =
radgroupreply.GroupName ORDER BY radgroupreply.id'
rlm_sql (sql): Released sql socket id: 2
  modcall[authorize]: module "sql" returns ok
modcall: group authorize returns ok
  rad_check_password:  Found Auth-Type System
auth: type "System"
modcall: entering group authenticate
  modcall[authenticate]: module "unix" returns notfound
modcall: group authenticate returns notfound
auth: Failed to validate the user.
Delaying request 2 for 1 seconds
Finished request 2
Going to the next request
--- Walking the entire request list ---
Waking up in 1 seconds...
--- Walking the entire request list ---
Waking up in 1 seconds...
--- Walking the entire request list ---
Sending Access-Reject of id 17 to 192.168.1.100:1880
Waking up in 4 seconds...
--- Walking the entire request list ---
Cleaning up request 2 ID 17 with timestamp 3e5f2092
Nothing to do.  Sleeping until we see a request.


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html