Repository navigation
Detect invalid permissions files on Bukkit servers - #219
Merged
Merged
Conversation
…file-invalid # Conflicts: # lang/en.json # src/Analyser/BukkitAnalyser.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The server loads custom permissions from
permissions.yml(or the file set aspermissions-fileinbukkit.yml).When the file is not valid YAML, all permissions in it are ignored, and when it defines a permission that the server or a plugin already registered, that permission is skipped.
Neither was detected before.
This PR adds
PermissionsFileProblemto theBukkitAnalyser, because the messages come from CraftBukkit'sCraftServer#loadCustomPermissions()and also occur on Spigot.It has two variants:
FileDeleteSolutionPermissionRemoveSolutionThe line
Permission in permissions.yml was already definedonly names the file, so the pattern also matches the exception in the next line to name the permission.Server permissions file ... is empty, ignoring itis intentionally not matched, because it is only an info.An already defined permission only happens when the file is loaded after the plugins, which is the default on Spigot, but not on Paper (
load-permissions-yml-before-pluginsinpaper-global.yml).Changes
PermissionsFileProblemPermissionRemoveSolutionpaper-permissions-file-invalid-26-3.log,paper-permissions-file-not-a-map-26-3.logandpaper-permission-already-defined-26-3.log