Minetest logo

IRC log for #minetest-dev, 2020-02-07

| Channels | #minetest-dev index | Today | | Google Search | Plaintext

All times shown according to UTC.

Time Nick Message
00:03 fluxflux joined #minetest-dev
01:11 ANAND joined #minetest-dev
01:25 p_gimeno ah here's my discussion about sandboxing: https://love2d.org/forums/viewtopic.php?p=221790#p221790
01:26 p_gimeno it's not really love specific, the only love specific calls are love.filesystem.load (to load a file using PhysFS, but that's not necessary here) and love.event.quit to exit.
01:28 p_gimeno love.filesystem.load works like Lua's loadfile
01:32 p_gimeno it's probably a moot point, unless someone uses deserialize on user input as discussed (I doubt anyone does, but the possibility is scary).
01:44 pmp-p joined #minetest-dev
02:42 erlehmann joined #minetest-dev
02:43 nashimus joined #minetest-dev
03:00 nepugia joined #minetest-dev
03:37 Taoki joined #minetest-dev
03:47 ssieb joined #minetest-dev
05:31 ANAND joined #minetest-dev
07:34 p_gimeno about #9369: setfenv(f, safe and {loadstring = function() end} or env) - don't create the table on the fly, that's a waste of resources
07:34 ShadowBot https://github.com/minetest/minetest/issues/9369 -- Fix misleading documentation on minetest.deserialize(). by luk3yx
07:38 p_gimeno oh maybe the table is necessary, but the function definitively isn't
07:52 p_gimeno but either both tables are created on the fly, or none is. Does the function need an environment shared between calls?
07:52 p_gimeno the function -> the code to deserialize
08:00 erlehmann joined #minetest-dev
08:25 pmp-p joined #minetest-dev
08:38 ShadowNinja joined #minetest-dev
08:57 sfan5 p_gimeno: the environment does not need to be shared, but there's no reason to recreate it since it doesn't change
08:57 sfan5 however...
09:00 sfan5 > =deserialize("x = 12344")
09:00 sfan5 nil
09:00 sfan5 > =deserialize("return x")
09:00 sfan5 12344
09:00 sfan5 ..is what happens if you don't recreate the environment
09:00 p_gimeno yes that was my thought too
09:02 p_gimeno maybe: safe_env = setmetatable({loadstring = ...}, {__newindex = function() error("Deserialized functions can't create globals") end}
09:02 p_gimeno )
09:04 sfan5 what if you modify the loadstring global? is there anything you can do using a function object?
09:05 p_gimeno an empty one? not that I know
09:05 p_gimeno you could destroy it for subsequent callers though (DoS)
09:06 sfan5 well this also goes for the non-safe env, can you modify a function without replacing the reference itself?
09:06 p_gimeno functions are immutable if that's what you mean
09:08 sfan5 Hope that's 100% true and not just "true unless you do weird things with it"
09:09 sfan5 (the debug library can edit functions after they exist, but that's not available here of course)
09:10 p_gimeno can it? I thought it could modify upvalues, not code
09:11 sfan5 that's what I was thinking of
09:12 p_gimeno yeah, not without debug.setupvalue/setlocal
09:15 realzies joined #minetest-dev
09:45 p_gimeno I can't help wondering why deserialize needs access to loadstring
09:48 sfan5 it supports serializing functions
09:48 sfan5 but in practice that doesn't work anyway since mod security forbids you to load bytecode
09:55 p_gimeno I'm curious about something. In the nested loadstring call, is loadstring treated as an upvalue or as a global? in the latter case, wouldn't it reference the current environment, infinitely recursing on loadstring()?
09:56 p_gimeno that would solved by localizing them: local loadstring, setfenv = loadstring, setfenv
10:03 p_gimeno tested, it seems to work as expected by referencing the environment at definition time
10:08 rubenwardy Loadstring isn't called in the serialised string
10:08 rubenwardy The serialised string is a Lua function which returns the table
10:08 rubenwardy Without the function syntax
10:09 rubenwardy Nested tables are done using a companion table
10:09 sfan5 https://github.com/minetest/minetest/blob/master/builtin/common/serialize.lua#L121
10:10 rubenwardy That should not be supported
10:11 rubenwardy From the beginning
10:11 rubenwardy Why was that considered a good idea
10:34 T4im joined #minetest-dev
10:38 df458 joined #minetest-dev
11:27 texmex joined #minetest-dev
11:27 kollaps[m] joined #minetest-dev
11:28 Qiangong2[m] joined #minetest-dev
11:33 Fixer joined #minetest-dev
11:35 proller joined #minetest-dev
12:00 Beton joined #minetest-dev
12:56 absurb joined #minetest-dev
13:11 proller joined #minetest-dev
14:09 Taoki joined #minetest-dev
14:59 pmp-p joined #minetest-dev
15:06 calcul0n joined #minetest-dev
15:15 proller joined #minetest-dev
16:47 Fixer joined #minetest-dev
17:03 YuGiOhJCJ joined #minetest-dev
17:25 Fixer joined #minetest-dev
17:29 CBugDCoder joined #minetest-dev
17:31 Krock joined #minetest-dev
17:39 Fixer joined #minetest-dev
18:25 Fixer joined #minetest-dev
18:27 Fixer_ joined #minetest-dev
18:32 Fixer joined #minetest-dev
18:33 Fixer_ joined #minetest-dev
19:01 AntumDeluge joined #minetest-dev
19:28 ssieb joined #minetest-dev
19:58 Andrey01 joined #minetest-dev
20:04 AntumD joined #minetest-dev
20:09 NoctisLabs joined #minetest-dev
20:11 NoctisLa1 joined #minetest-dev
20:11 Andrey01 hello, I`m currently playing around Irrlicht Engine and I have some issues: the animated node looks like very jerky and surprisingly the node disappears if it is at edge of the camera view range
20:12 Andrey01 does anybody know how to solve these issues? here is a code: https://ufile.io/n6kb0kt7
20:13 NoctisLa1 joined #minetest-dev
20:37 NoctisLa1 joined #minetest-dev
20:40 NoctisLa1 joined #minetest-dev
20:56 NoctisLa1 joined #minetest-dev
21:25 NoctisLa1 joined #minetest-dev
21:28 NoctisLabs joined #minetest-dev
21:34 NoctisLa1 joined #minetest-dev
21:45 paramat joined #minetest-dev
21:45 paramat will merge trivial game#2588 in 2 hours
21:45 ShadowBot https://github.com/minetest/minetest_game/issues/2588 -- Fix simple bed height, make player lay down just above it, not inside it by paramat
22:40 df458 joined #minetest-dev
22:45 behalebabo joined #minetest-dev
22:52 proller joined #minetest-dev
23:27 absurb_ joined #minetest-dev
23:29 Wuzzy joined #minetest-dev
23:33 pmp-p joined #minetest-dev
23:51 Wuzzy any ideas on how to make an unit test for pathfinder?
23:52 Wuzzy pathfinder relies on a real existing world with real nodes, so it seems a pathfinder unit test would first have to get access to a dummy world ... tricky. what do you think?

| Channels | #minetest-dev index | Today | | Google Search | Plaintext