mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
libctrl: Don't overwrite error reply if the verify function sets one
This commit is contained in:
committed by
Holger Hans Peter Freyther
parent
5763093285
commit
9cc771bd3d
@@ -137,6 +137,8 @@ int ctrl_cmd_exec(vector vline, struct ctrl_cmd *command, vector node, void *dat
|
||||
if (cmd_el->verify) {
|
||||
if ((ret = cmd_el->verify(command, command->value, data))) {
|
||||
ret = CTRL_CMD_ERROR;
|
||||
/* If verify() set an appropriate error message, don't change it. */
|
||||
if (!command->reply)
|
||||
command->reply = "Value failed verification.";
|
||||
goto out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user