miney-py / mineysocket

A network api for minetest
GNU Lesser General Public License v3.0
14 stars 9 forks source link

mineysocket crashes on wrong authentication #1

Closed helge17 closed 3 years ago

helge17 commented 3 years ago

When authentication is not successful mineysocket and Minetest crash. This is because there is some UDP code left in init.lua; fix:

$ diff init.lua.orig init.lua
287c287
<         server:sendto(mineysocket.json.encode({ error = "authentication error" }) .. "\n", ip, port)
---
>         mineysocket.send(clientid, mineysocket.json.encode({ error = "authentication error" }))
292c292
<     server:sendto(mineysocket.json.encode({ error = "authentication error" }) .. "\n", ip, port)
---
>     mineysocket.send(clientid, mineysocket.json.encode({ error = "authentication error" }))
Netzvamp commented 3 years ago

I've fixed that now. I've actual never tried to connect from outside 127.0.0.1 😄

Also i strongly advise to not let everyone from the internet connect to the port, cause then they can inject lua and corrupt your whole system. Pls, be careful!

But cool that someone cares about this thing, that motivated me to continue with miney ... i hope i release a new version soon (tm) ... at least i commit my current code ...