help-gnu-radius
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gnu-radius] Accounting using external program


From: Farooq Ahmed
Subject: [Help-gnu-radius] Accounting using external program
Date: Tue, 08 Apr 2003 07:19:54 -0400

First of all Thanks to "Sergey" and others for helping time to time.
His guidance realy help me in working on radius.


I m again here with more question?

Q1==>

i compiled radius with the following options
PWD_SHADOW USE_PAM USE_SQL_MYSQL USE_SQL_ODBC

but when i try to authenticate users from "MS SQL" i failed.
can i use gnu-radius with MS SQL?

Q2==> 

During the accounting session , First of all we get Accounting start Packet and 
then Accounting Stop Packet.
When radius recieve accounting stop packet . radius runs a 
query to update database . I want to run anohter query at this time.For this i 
find "Acct-Ext-Program" Attribute in the documentation and i put the line in 
the raddb/hints file.

DEFAULT Suffix = ".ppp", Strip-User-Name = Yes
        Hint = "PPP",
        Service-Type = Framed-User,
        Framed-Protocol = PPP,
        Acct-Ext-Program = "/usr/libexec/accounting.sh"  



But all these attributes are inactive and nothing is happening.

How can i do accounting using External program (i do not want to use guile) ?


Regrads
Allah Hafiz :)
Farooq

 


--------- Forwarded Message ---------

DATE: Thu, 03 Apr 2003 15:55:17
From: Sergey Poznyakoff <address@hidden>
To: address@hidden
Cc:address@hidden
Salam!

> I need some examples related to the using of Session-Timeout  attribute.  

The basic usage is very simple: the attribute should appear in the
reply pairs, its argument is the timeout value in seconds. If this
value must be computed at the runtime (e.g. depending on the status
of the user's account), you should use an extension mechanism (either
Scheme or an external program. Examples:

1) Using external procedure.

# raddb/users:
DEFAULT  Auth-Type = SQL
                   <..other check pairs..>
         Service-Type = Framed-User,
                   Framed-Protocol = PPP,
                   Exec-Program-Wait = "/usr/libexec/my-auth %C{User-Name}"

Now, the my-auth program must compute the value of the timeout, print
the reply attributes on the standard output and return 0. If it were
written in shell, then:

#! /bin/sh

# Obtain the value of the timeout. $1 is the username.
...

echo "Session-Timeout = $TIMEOUT"
exit 0


2) Using Guile extension

# raddb/users:
DEFAULT  Auth-Type = SQL
                   <..other check pairs..>
         Service-Type = Framed-User,
                   Framed-Protocol = PPP,
                   Scheme-Procedure = "myauth"

The framework for the Scheme procedure "myauth" follows:

(define (auth req check reply)
  (let ((username (assoc "User-Name" req))
        timeout)
    ; .. compute the value of the timeout and assign it to the
    ; variable `timeout'
    ; ....
    ; Return:
    (cons #t
          (append reply (list (cons "Session-Timeout" timeout))))))

For more information about radius extensions see the following links:

http://www.gnu.org/software/radius/manual/html_chapter/radius_14.html#SEC96
http://www.gnu.org/software/radius/manual/html_chapter/radius_17.html#SEC193

Kho'da Ha'fez,
Sergey

--------- End Forwarded Message ---------



____________________________________________________________
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]