libctrl: Don't overwrite error reply if the verify function sets one

This commit is contained in:
Daniel Willmann 2011-07-28 21:38:51 +02:00 committed by Harald Welte
parent f7c74e5879
commit 9225ab1ecc
1 changed files with 3 additions and 1 deletions

View File

@ -137,7 +137,9 @@ 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;
command->reply = "Value failed verification.";
/* If verify() set an appropriate error message, don't change it. */
if (!command->reply)
command->reply = "Value failed verification.";
goto out;
}
} else if (cmd_el->param) {