I need to be able to fire off a script via the Exec-Program (or some other method) based upon a successful authentication and the value of an LDAP attribute on the user's account. I tried putting the following in the acct_users... DEFAULT Acct-Status-Type == Start, CustomAttrib == true Exec-Program = "/path/to/script.sh %u %{Framed-IP-Address} %{CustomAttrib}" I've tried setting the ItemType of the CustomAttrib to checkItem and replyItem, but neither method worked. My script needs access to the username and the Framed-IP-Address. Any suggestions?
John Wever wrote:
DEFAULT Acct-Status-Type == Start, CustomAttrib == true
That *matches* the Custom Attribute. Is that what you want?
Exec-Program = "/path/to/script.sh %u %{Framed-IP-Address} %{CustomAttrib}"
I've tried setting the ItemType of the CustomAttrib to checkItem and replyItem, but neither method worked. My script needs access to the username and the Framed-IP-Address.
Any suggestions?
Read doc/variables.txt to see how to refer to attributes in the reply or check item list. Alan DeKok.
Yes, thats exactly what I want, but the script is never fired. It is my understanding that the acct_users file only sees accounting packet data, if the CustomAttrib is a checkItem would it even be available to query at this point? Just as info, I take off the ", CustomAttrib == true" and the script fires as expected for all authenticated users. Alan DeKok wrote:
John Wever wrote:
DEFAULT Acct-Status-Type == Start, CustomAttrib == true
That *matches* the Custom Attribute. Is that what you want?
Exec-Program = "/path/to/script.sh %u %{Framed-IP-Address} %{CustomAttrib}"
I've tried setting the ItemType of the CustomAttrib to checkItem and replyItem, but neither method worked. My script needs access to the username and the Framed-IP-Address.
Any suggestions?
Read doc/variables.txt to see how to refer to attributes in the reply or check item list.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
John Wever wrote:
Yes, thats exactly what I want, but the script is never fired. It is my understanding that the acct_users file only sees accounting packet data,
Yes.
if the CustomAttrib is a checkItem would it even be available to query at this point?
The acct_users file can't do comparisons on check items. So what you're trying to do is impossible in 1.x. See CVS head and "unlang" for how to do this easily. Alan DeKok.
participants (2)
-
Alan DeKok -
John Wever