Copilot commented on code in PR #13570:
URL: https://github.com/apache/trafficserver/pull/13570#discussion_r3905548832
##########
src/traffic_ctl/CtrlCommands.cc:
##########
@@ -555,6 +555,14 @@ ConfigCommand::config_reload()
_printer->write_output("");
}
+ // Without content the request would silently degrade to a full reload of
every handler,
+ // which is the opposite of the scoped reload the operator asked for.
+ if (data_args && data_args.size() == 0) {
+ _printer->write_output("Error: --data (-d) requires content: @file, @- or
a YAML string");
+ App_Exit_Status_Code = CTRL_EX_ERROR;
+ return;
+ }
Review Comment:
The new "-d requires content" guard only checks size()==0, but `-d ""` (or
`-d $UNSET_VAR` when it expands to an empty argument) produces a single empty
token. That currently bypasses the guard, is skipped by the `if
(data_arg.empty()) continue;` loop, and can still silently degrade into a full
reload.
This issue also appears on line 597 of the same file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]