[Bucardo-general] Patch, Added $self to input for custom code

Ben Allen bsa at lanl.gov
Tue Mar 24 04:23:11 UTC 2009


Greg,

Hows the attached patch for adding support for using the send_mail sub  
in custom code. It makes an anonymous sub that calls $self- 
 >send_mail(@_). Then pass the reference of that new sub in $input. If  
I just passed the ref \&send_mail, $self wasn't maintained, and  
send_mail would fail.

Regards,

Ben


-------------- next part --------------
A non-text attachment was scrubbed...
Name: sendmail_customcode.patch
Type: application/octet-stream
Size: 610 bytes
Desc: not available
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20090324/ebe0dce5/attachment.obj 
-------------- next part --------------

On Mar 23, 2009, at 3:55 PM, Greg Sabino Mullane wrote:

> Ben Allen wrote:
>> Attached is a patch that passes $self in the run_kid_custom_code
>> function of Bucardo.pm in the $input hashref.
>
> I'm very wary of something like this, as it seems a huge footgun  
> waiting to
> happen. I'd be much happier having it pass something a little safer,  
> such as
> perhaps a coderef to the send_mail subroutine?
>
> -- 
> Greg Sabino Mullane greg at endpoint.com
> End Point Corporation
> PGP Key: 0x14964AC8
>

Ben Allen

System Administrator
Influenza Sequence Database
Los Alamos National Laboratory



More information about the Bucardo-general mailing list