Hello Richi -

On Thu, 13 Jan 2000, Richi Plana wrote:
> Hi,
> 
> I've looked at the archives and it seems several people's problems
> (Antonio Navarro and Janet del Mundo) including mine haven't been exactly
> resolved. The problem is when one wants to modify the objects being passed
> to a Pre/PostAuthHook subroutine. It seems that the object that gets
> modified is local in scope to the called subroutine. Though the object in
> the AuthHook subroutine gets modified, the original object doesn't. (ie.
> 
> sub {
>       ${$_[0]}->add_attr("Filter-Id", "test");
> }
> 
> modifies the local object (in this case, the passed request object), but
> doesn't affect the original object).
> 

Actually, what is being passed is a pointer (to a pointer) to the incoming
packet (0 is the incoming request packet, 1 is the reply packet being
constructed and 2 is the result of the authentication). The ${$_[0]}
dereferences the pointer so you are manipulating the packet itself when you use 

        ${$_[0]}->add_attr("Filter-Id", "test"); 

Hence any further processing of the packet will find whatever you have put
there (or changed).

hth

Hugh


-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, etc etc on Unix, Win95/8,
NT, Rhapsody

===
Archive at http://www.thesite.com.au/~radiator/
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to