-
Notifications
You must be signed in to change notification settings - Fork 939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
templates: block nested template executors #1677
Merged
ashishjh-bst
merged 8 commits into
botlabs-gg:dev
from
SoggySaussages:block-nested-template-executors
Jun 21, 2024
Merged
templates: block nested template executors #1677
ashishjh-bst
merged 8 commits into
botlabs-gg:dev
from
SoggySaussages:block-nested-template-executors
Jun 21, 2024
Conversation
This file contains 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
@SoggySaussages, you may want to rebase this onto dev. |
Add a flag for templates which are executed from the templates of inbuilt commands. Signed-off-by: SoggySaussages <[email protected]>
Blocks nested exec/execAdmin calls by passing an "executedByCommandTemplate" flag through moderation command execution. When this flag reaches a new context created by a moderation command, it turns into ExecutedFromNextedCommandTemplate. This flag blocks moderation commands from running. Signed-off-by: SoggySaussages <[email protected]>
Blocks nested exec/execAdmin calls and createTicket calls by passing an "executedByCommandTemplate" flag through moderation command execution. When this flag reaches a new context created by a ticket, it turns into ExecutedFromNextedCommandTemplate. This flag blocks moderation commands and tickets from running. Signed-off-by: SoggySaussages <[email protected]>
Signed-off-by: SoggySaussages <[email protected]>
Signed-off-by: SoggySaussages <[email protected]>
Signed-off-by: SoggySaussages <[email protected]>
Signed-off-by: SoggySaussages <[email protected]>
Signed-off-by: SoggySaussages <[email protected]>
SoggySaussages
force-pushed
the
block-nested-template-executors
branch
from
June 20, 2024 21:46
65f0207
to
2ab2d43
Compare
Thx, donezo |
ashishjh-bst
pushed a commit
to ashishjh-bst/yagpdb
that referenced
this pull request
Jun 27, 2024
* templates: flag templates executed by inbuilt cmds Add a flag for templates which are executed from the templates of inbuilt commands. Signed-off-by: SoggySaussages <[email protected]> * moderation: block nested exec(Admin) calls Blocks nested exec/execAdmin calls by passing an "executedByCommandTemplate" flag through moderation command execution. When this flag reaches a new context created by a moderation command, it turns into ExecutedFromNextedCommandTemplate. This flag blocks moderation commands from running. Signed-off-by: SoggySaussages <[email protected]> * tickets: block nested exec(Admin) calls Blocks nested exec/execAdmin calls and createTicket calls by passing an "executedByCommandTemplate" flag through moderation command execution. When this flag reaches a new context created by a ticket, it turns into ExecutedFromNextedCommandTemplate. This flag blocks moderation commands and tickets from running. Signed-off-by: SoggySaussages <[email protected]> * moderation: fix nesting detection Signed-off-by: SoggySaussages <[email protected]> * tickets: fix nesting detection Signed-off-by: SoggySaussages <[email protected]> * templates: block execCC from inbuilt cmd templates Signed-off-by: SoggySaussages <[email protected]> * moderation: further fix nest detection Signed-off-by: SoggySaussages <[email protected]> * tickets: further fix nest detection Signed-off-by: SoggySaussages <[email protected]> --------- Signed-off-by: SoggySaussages <[email protected]>
ashishjh-bst
pushed a commit
to ashishjh-bst/yagpdb
that referenced
this pull request
Jun 27, 2024
* templates: flag templates executed by inbuilt cmds Add a flag for templates which are executed from the templates of inbuilt commands. Signed-off-by: SoggySaussages <[email protected]> * moderation: block nested exec(Admin) calls Blocks nested exec/execAdmin calls by passing an "executedByCommandTemplate" flag through moderation command execution. When this flag reaches a new context created by a moderation command, it turns into ExecutedFromNextedCommandTemplate. This flag blocks moderation commands from running. Signed-off-by: SoggySaussages <[email protected]> * tickets: block nested exec(Admin) calls Blocks nested exec/execAdmin calls and createTicket calls by passing an "executedByCommandTemplate" flag through moderation command execution. When this flag reaches a new context created by a ticket, it turns into ExecutedFromNextedCommandTemplate. This flag blocks moderation commands and tickets from running. Signed-off-by: SoggySaussages <[email protected]> * moderation: fix nesting detection Signed-off-by: SoggySaussages <[email protected]> * tickets: fix nesting detection Signed-off-by: SoggySaussages <[email protected]> * templates: block execCC from inbuilt cmd templates Signed-off-by: SoggySaussages <[email protected]> * moderation: further fix nest detection Signed-off-by: SoggySaussages <[email protected]> * tickets: further fix nest detection Signed-off-by: SoggySaussages <[email protected]> --------- Signed-off-by: SoggySaussages <[email protected]>
ashishjh-bst
added a commit
to ashishjh-bst/yagpdb
that referenced
this pull request
Jun 28, 2024
This reverts commit d3da699.
SoggySaussages
added a commit
to SoggySaussages/yagpdb-main
that referenced
this pull request
Jul 10, 2024
This reverts commit 8b8ebbc.
ashishjh-bst
pushed a commit
that referenced
this pull request
Aug 28, 2024
galen8183
pushed a commit
to galen8183/yagpdb
that referenced
this pull request
Nov 12, 2024
* Reapply "templates: block nested template executors (botlabs-gg#1677)" This reverts commit 8b8ebbc. * Reapply "customcommands: relax restriction on execCC from command templates (botlabs-gg#1684)" This reverts commit 3f743b0.
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.
This PR blocks looping
exec
orexecAdmin
on commands which parse a template (such as moderation actions' PunishDM or the opening message in a ticket).
Upon executing one of these commands, a new context flag marks it as executed from a command template. If within this
new template one of these commands is used again, its context gets a flag marking it as executed from a nested
command template. Any of the functions executed within a nested command template will fail.
This PR also blocks using
execCC
within any of these commands' templates. This will likely soon be mollified by the addition of an 'autoScheduleExecCC' function suggested by @jo3-l which will allow users to once again execute CCswithin these commands' templates in a manageable and rate limited fashion.
Signed-off-by SoggySaussages [email protected]