irc icon indicating copy to clipboard operation
irc copied to clipboard

!whereis can be misused by players on Survival / PvP servers

Open ClobberXD opened this issue 6 years ago • 9 comments

(Originally reported here: rubenwardy/capturetheflag#107)

I suggest restricting !whereis to chan OPs if possible.

Will work on implementing this if approved.

ClobberXD avatar Jul 12 '18 08:07 ClobberXD

I've been thinking about removing that command. I'll accept a PR.

kaeza avatar Jul 12 '18 18:07 kaeza

In my opinion, !whereis is still useful for server staff... Shall I try to restrict that command to chan OPs as mentioned in my previous comment?

ClobberXD avatar Jul 12 '18 18:07 ClobberXD

Sure.

kaeza avatar Jul 12 '18 18:07 kaeza

definitely worth doing

sofar avatar Aug 16 '18 04:08 sofar

Figured out how to get it to work, but I'm facing a (minor?) issue:

  • irc.conn.channels[irc.config.channel] contains a table of users in the channel, called users.
  • Each user in the table is indexed by their nick (user.nick), and stores an access table, with boolean flags for user-mode +o and +v.
  • The issue here is that the user's access table users[user.nick].access is empty. Am I missing something? Do I have to invoke some sort of an update function before accessing the table?

ClobberXD avatar Aug 16 '18 07:08 ClobberXD

From https://github.com/JakobOvrum/LuaIRC/blob/master/doc/irc.luadoc :

Apart from nick , fields may be missing. To fill them in, enable user tracking

And

Turn user information tracking on or off. User tracking is enabled by default. param b Boolean whether or not to track user information. function irc:trackUsers(b)

Either that, or track modes yourself with the OnUserMode callback.

That's what I get from a quick look at the docs and code, but you should probably ask upstream.

kaeza avatar Aug 16 '18 22:08 kaeza

User tracking is enabled by default.

If tracking is set to true by default (and it really is enabled, I checked), then this most likely is an upstream bug.

I initially did plan on using OnUserMode callback. I'll see if that works...

ClobberXD avatar Aug 17 '18 01:08 ClobberXD

How about removing this command from irc altogether? Commands like these should ideally be a part of MT itself.

minetest/minetest#7677 :)

ClobberXD avatar Aug 25 '18 09:08 ClobberXD

I've abandoned this, and the aforementioned PR in MT has been rejected. Anyone else interested is welcome to take this up.

magnetar47 avatar Aug 13 '22 15:08 magnetar47