[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.4.0 (alpha) now available
- From: Sean Conner <sean@...>
- Date: Sun, 23 Jun 2019 20:09:35 -0400
It was thus said that the Great Andrew Gierth once stated:
> >>>>> "Sean" == Sean Conner <sean@conman.org> writes:
>
> >> This is one of only two places in the whole Lua codebase, and is the
> >> only library function, where __close is used (in both cases the code
> >> just sets __close = __gc).
>
> Sean> Now that I think about it, why have __close at all? Why not
> Sean> have locals marked as <toclose> just call __gc upon leaving
> Sean> scope?
>
> 1) you might not want __close and __gc to do the same thing, and if you
> do want it, it's trivial to assign the same function to both
>
> 2) it would allow any object with __gc but not __close to be assigned to
> a toclose variable, and that breaks a sandbox's control over error
> handling
How could it break a sandbox? I mean, I can do:
f = io.open(somevalidfile)
f:__gc()
(that only works because the file's metatable has __index set to the
metatalbe, and it has the __gc method visible in it)
-spc (Puzzled by the "break the sandbox" answers ... )
- References:
- [ANN] Lua 5.4.0 (alpha) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.4.0 (alpha) now available, Dibyendu Majumdar
- Re: [ANN] Lua 5.4.0 (alpha) now available, Andrew Gierth
- Re: [ANN] Lua 5.4.0 (alpha) now available, Dibyendu Majumdar
- Re: [ANN] Lua 5.4.0 (alpha) now available, Patrick Donnelly
- Re: [ANN] Lua 5.4.0 (alpha) now available, Andrew Gierth
- Re: [ANN] Lua 5.4.0 (alpha) now available, Andrew Gierth
- Re: [ANN] Lua 5.4.0 (alpha) now available, Paul Ducklin
- Re: [ANN] Lua 5.4.0 (alpha) now available, Sean Conner
- Re: [ANN] Lua 5.4.0 (alpha) now available, Andrew Gierth