CraftBook icon indicating copy to clipboard operation
CraftBook copied to clipboard

Make sure to remove perm/op after command

Open Phoenix616 opened this issue 4 years ago • 6 comments

This change makes sure that the wildcard permission and op status are properly removed from the player after the command in the command items or custom crafting configs are executed even if any kind of exception occurred while executing it.

Also adjusted the CustomCrafting op setters to work the same way as the CommandItems ones (checking the wasOp) and explicitly setting the op to false after execution to improve code readability.

Phoenix616 avatar Jul 22 '21 11:07 Phoenix616

The reason this isn't done is that it was causing server deadlocks in some cases.

Generally the SUPERUSER commanditem run as type is no longer supported, and will be fully removed in CB5.

It may be replaced with a permission attachment system, but generally that doesn't work too well with how perm plugins do caching now. Console is the recommended way

me4502 avatar Jul 22 '21 11:07 me4502

Tbh. I feel like a deadlock would still be a lot better than a player walking around with op and * permission.

Phoenix616 avatar Jul 22 '21 11:07 Phoenix616

The deadlock was much more likely than the case you described. Really I'd prefer to keep it in the "not recommended" state as is with it /mostly/ working, then remove it in CB5 where people won't send me death threats for months for removing a feature in a non-major release

me4502 avatar Jul 22 '21 11:07 me4502

To clarify - changing it to this makes the feature detrimental enough that it's /likely/ to cause problems, which massively increases the current risk factor. I'd rather entirely remove it than introduce the deadlock issue

me4502 avatar Jul 22 '21 11:07 me4502

Do you have any further information on the deadlock? Because I have been running a similar code for years without any issues...

Phoenix616 avatar Jul 22 '21 11:07 Phoenix616

Not really - it was just something that got reported a lot without reproducibility on my end

me4502 avatar Jul 22 '21 11:07 me4502