On Friday, August 30, 2019 12:18:10 AM EDT you wrote:
> Scott, I think there are 2 issues here:
> 1. The bug in pyspf, that causes the policyd-spf crash
> 2. The fact that policyd-spf crashes on an invalid record. Wouldn't a
> try/except block be a better approach? Something like:
>
> try:
> mres = mfromquery.check()
> except Exception as e:
> e = sys.exc_info()
> exceptionmessage = "Exception: %s, locals: %s" %(e, locals())
> syslog.syslog("Ouch, caught exc: %s" %exceptionmessage)
> return(( 'dunno', exceptionmessage, instance_dict, None))
In theory I could do that, but this isn't a case where an error is ever an
appropriate response. pyspf should detect that this is an invalid record by
catching the ipaddress error.
On Friday, August 30, 2019 12:18:10 AM EDT you wrote: syslog( "Ouch, caught exc: %s" %exceptionmessage)
> Scott, I think there are 2 issues here:
> 1. The bug in pyspf, that causes the policyd-spf crash
> 2. The fact that policyd-spf crashes on an invalid record. Wouldn't a
> try/except block be a better approach? Something like:
>
> try:
> mres = mfromquery.check()
> except Exception as e:
> e = sys.exc_info()
> exceptionmessage = "Exception: %s, locals: %s" %(e, locals())
> syslog.
> return(( 'dunno', exceptionmessage, instance_dict, None))
In theory I could do that, but this isn't a case where an error is ever an
appropriate response. pyspf should detect that this is an invalid record by
catching the ipaddress error.
Scott K