LuckPerms

LuckPerms

41.4k Downloads

Regex error for regex permission node

BrainStone opened this issue ยท 5 comments

commented

This permission node: " R=(bungeecord\.server|pjp\.servers|pc\.core\.command\.server)\.(creative|farm|lobby|survival)(\.base)?" causes the following exception when permissions are being checked.

(I know the node is wrong, but it almost broke my server and that shouldn't happen!)

java.util.regex.PatternSyntaxException: Illegal repetition near index 30
pc\.core\.command\.server\.farm{\.base}?
at java.util.regex.Pattern.error(Pattern.java:1955) ~[?:1.8.0_151]
at java.util.regex.Pattern.closure(Pattern.java:3157) ~[?:1.8.0_151]
at java.util.regex.Pattern.sequence(Pattern.java:2134) ~[?:1.8.0_151]
at java.util.regex.Pattern.expr(Pattern.java:1996) ~[?:1.8.0_151]
at java.util.regex.Pattern.compile(Pattern.java:1696) ~[?:1.8.0_151]
at java.util.regex.Pattern.<init>(Pattern.java:1351) ~[?:1.8.0_151]
at java.util.regex.Pattern.compile(Pattern.java:1028) ~[?:1.8.0_151]
at me.lucko.luckperms.common.utils.PatternCache.lambda$static$0(PatternCache.java:40) ~[?:?]
at me.lucko.luckperms.lib.caffeine.cache.UnboundedLocalCache$UnboundedLocalLoadingCache.lambda$new$0(UnboundedLocalCache.java:929) ~[?:?]
at me.lucko.luckperms.lib.caffeine.cache.UnboundedLocalCache.lambda$computeIfAbsent$2(UnboundedLocalCache.java:236) ~[?:?]
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688) ~[?:1.8.0_151]
at me.lucko.luckperms.lib.caffeine.cache.UnboundedLocalCache.computeIfAbsent(UnboundedLocalCache.java:232) ~[?:?]
at me.lucko.luckperms.lib.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:112) ~[?:?]
at me.lucko.luckperms.lib.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:67) ~[?:?]
at me.lucko.luckperms.common.utils.PatternCache.compile(PatternCache.java:47) ~[?:?]
at me.lucko.luckperms.common.processors.RegexProcessor.refresh(RegexProcessor.java:60) ~[?:?]
at me.lucko.luckperms.common.calculators.PermissionCalculator.setSourcePermissions(PermissionCalculator.java:124) ~[?:?]
at me.lucko.luckperms.common.caching.type.PermissionCache.setPermissionsInternal(PermissionCache.java:86) ~[?:?]
at me.lucko.luckperms.common.caching.type.PermissionCache.setPermissions(PermissionCache.java:92) ~[?:?]
at me.lucko.luckperms.common.caching.AbstractCachedData.calculatePermissions(AbstractCachedData.java:156) ~[?:?]
at me.lucko.luckperms.common.caching.AbstractCachedData.calculatePermissions(AbstractCachedData.java:216) ~[?:?]
at me.lucko.luckperms.common.caching.AbstractCachedData$PermissionCacheLoader.load(AbstractCachedData.java:397) ~[?:?]
at me.lucko.luckperms.common.caching.AbstractCachedData$PermissionCacheLoader.load(AbstractCachedData.java:394) ~[?:?]
at me.lucko.luckperms.lib.caffeine.cache.CacheLoader.lambda$asyncLoad$0(CacheLoader.java:105) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) ~[?:1.8.0_151]
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1582) ~[?:1.8.0_151]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_151]
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_151]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_151]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) ~[?:1.8.0_151]
commented

Edit: The same error gets thrown without the space.

commented

If I had to guess then that the shorthand notation gets expanded in regex too, which it most certainly shouldn't!

commented

Should be fixed by ^^

You'll need to re-set the regex permissions you have, the current version was stripping all of the escaping from them :(

commented

In the database the escaping was present though!

commented

Hm, maybe you'll be ok then :)