[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is the registry needed?
- From: Sean Conner <sean@...>
- Date: Thu, 1 Oct 2015 11:55:18 -0400
It was thus said that the Great Patrick Donnelly once stated:
> On Wed, Sep 30, 2015 at 4:54 PM, Sean Conner <sean@conman.org> wrote:
> > It was thus said that the Great Soni L. once stated:
> >> This is VERY unsafe! You're potentially breaking a sandbox by doing a
> >> sethook. And you don't reset it, either.
> >
> > If you mean "I don't call lua_sethook(L,NULL,0,0)" then you have misread
> > the code---I do call that. But if you mean "I don't restore the previous
> > hooks" then you're right, I don't. When I first started this implementation
> > of the signal module, I was concerned about that. And I tried. And it was
> > very fragile. I then decided to check how other signal modules handled this
> > and guess what? NONE OF THEM RESTORE THE HOOKS! Not even the standalone
> > Lua interpeter bothers with restoring any hooks.
>
> https://github.com/batrick/lua-signal/blob/49b2fccf546ca0096af6aca26052eb0981e28f59/lsignal.c#L167-L211
Oh! Well ... um ... okay.
-spc (Eeek)