don't accept any arbitrary string as 'name' as we use it in a path
osmo_identifier_valid() is likely much more strict than just checking for invalid symbols in a path, but let's use it as we already have it around. Closes: OS#5748
This commit is contained in:
parent
738bad8e48
commit
4a4efc0b96
|
@ -124,6 +124,11 @@ DEFUN(cfg_itd_line_dahdi, cfg_itd_line_dahdi_cmd, "line NAME dahdi SPAN_NAME",
|
||||||
struct isdntap_line *line;
|
struct isdntap_line *line;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
if (!osmo_identifier_valid(name)) {
|
||||||
|
vty_out(vty, "%% Sorry, '%s' is not a valid identifier%s", name, VTY_NEWLINE);
|
||||||
|
return CMD_WARNING;
|
||||||
|
}
|
||||||
|
|
||||||
line = isdntap_line_find(vty_itd, name);
|
line = isdntap_line_find(vty_itd, name);
|
||||||
if (line) {
|
if (line) {
|
||||||
if (strcmp(line->drvdata.dahdi.name, span_name)) {
|
if (strcmp(line->drvdata.dahdi.name, span_name)) {
|
||||||
|
|
Loading…
Reference in New Issue