aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/vty_interface_layer3.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-06-24 08:06:38 +0200
committerHarald Welte <laforge@gnumonks.org>2010-06-24 08:06:38 +0200
commit9d4cca7a0ebbc781d89b9c51884a619cc2111876 (patch)
treeb021db7bc31f56b7bcafd3d8d21811e9a667b7a6 /openbsc/src/vty_interface_layer3.c
parent2788b96bf47349531564bcf33f4e64c094a222d0 (diff)
[BSC] Enable the use of whitespaces in the subscriber name
This patch (originally by Luca Bertoncello) adds support for spaces in the subscriber name when specified from the VTY.
Diffstat (limited to 'openbsc/src/vty_interface_layer3.c')
-rw-r--r--openbsc/src/vty_interface_layer3.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/openbsc/src/vty_interface_layer3.c b/openbsc/src/vty_interface_layer3.c
index 2a31df68..d80f7c9b 100644
--- a/openbsc/src/vty_interface_layer3.c
+++ b/openbsc/src/vty_interface_layer3.c
@@ -394,14 +394,14 @@ DEFUN(ena_subscr_authorizde,
DEFUN(ena_subscr_name,
ena_subscr_name_cmd,
- "subscriber " SUBSCR_TYPES " ID name NAME",
+ "subscriber " SUBSCR_TYPES " ID name .NAME",
SUBSCR_HELP "Set the name of the subscriber\n"
"Name of the Subscriber\n")
{
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
struct gsm_subscriber *subscr =
get_subscr_by_argv(gsmnet, argv[0], argv[1]);
- const char *name = argv[2];
+ char *name;
if (!subscr) {
vty_out(vty, "%% No subscriber found for %s %s%s",
@@ -409,7 +409,12 @@ DEFUN(ena_subscr_name,
return CMD_WARNING;
}
+ name = argv_concat(argv, argc, 2);
+ if (!name)
+ return CMD_WARNING;
+
strncpy(subscr->name, name, sizeof(subscr->name));
+ talloc_free(name);
db_sync_subscriber(subscr);
subscr_put(subscr);