fuzzball-muck / fuzzball

Ongoing development of the Fuzzball MUCK server software and associated functionality.
Other
47 stars 27 forks source link

In advancedb, regular wizards can't @register when compiled with GOD_PRIV #299

Closed natmeox closed 5 years ago

natmeox commented 5 years ago

Hi! To reproduce natmeox/hlm-suite#3, I:

  1. built fuzzball from commit 066ca6c
  2. set up a new advancedb
  3. connected as One
  4. reset Keeper's password with @newpassword Keeper=keeper
  5. connected as Keeper
  6. @set me=!Q
  7. pasted this file to produce a $lib/bits library

I expected this (specifically the @register command at the end) to work, but instead I received the error:

> @register lib-bits.muf=lib/bits
Permission denied. (You can't register an object there.)

This error does appear to be from the built-in @register command. (While the advancedb seems to contain a cmd-@register.muf(#63FLVM3) program, it's not installed as a global for some reason.) On line 1003 we can see that this error will occur whenever !controls(player, target). In the definition of controls(), we see that when GOD_PRIV is #defined, a wizard won't control() room #0. I confirmed that recompiling with #undef GOD_PRIV allowed Keeper to @register the library when unquelled.

Should we expect that only #1 can globally @register things? In practice, one could also have room #0 owned by a Player other than #1. Should room #0 in the advancedb be owned by Keeper?

wyld-sw commented 5 years ago

This should now be addressed: the builtin @register should bypass GOD_PRIV for #0.