external script collecting invironment variables

2005-08-22 Thread vicky

Hi all,

I'm run a home made script whenever I receive an accounting- start, 
stop or alive. In the script I get the value of all the attributes set 
in the environment variables (example : val = getenv(USER_NAME) ). I 
want to count how many attributes contain no value (or doesn't not 
exist) so I have a check (example : if(val == NULL) ) and I have a 
counter variable. I check with NULL because I thought when an attribute 
has no value, the value would be NULL butt apparently it is not always 
the case.


I guess it is different when the attribute is sent without a value and 
when it is not sent at all. I would like to know what value contains in 
these two cases. Anyone?


Thanks!

-- Vicky 

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


Re: external script collecting invironment variables

2005-08-22 Thread Alan DeKok
vicky [EMAIL PROTECTED] wrote:
 I guess it is different when the attribute is sent without a value and 
 when it is not sent at all. I would like to know what value contains in 
 these two cases. Anyone?

  An attribute which is not in the packet will now exist in the
environment variables.

  An attribute with no value will have an empty string as it's value.
But that will be very, very, rare.

  Alan DeKok.

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