-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, List!

I found a bug in OpenBSC. If I try to change the name of a subscriber
using Telnet (command "subscriber ... name") I got an error, if the
name contains spaces (for example: first and lastname).

I found the problem and I wrote a patches.
I send it as attachment.

Greetings
- -- 
_______________________________________________________________________
Luca Bertoncello
Entwicklung                               Mail:  bertonce...@netzing.de 


NETZING Solutions AG                      Tel.:  0351/41381 - 0
Kesselsdorfer Str. 216, 01169 Dresden     Fax:   0351/41381 - 12
HRB 18926 / Ust.ID DE211326547            Mail:  netzing...@netzing.de
_______________________________________________________________________
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFMH1ulAXzltVKV/2wRAlV9AJ9NoQUnUs9HL0d/UnExoBzfjbgZzwCeMJPy
NFRpXWHlpRKMTYftSrbqehI=
=b5i3
-----END PGP SIGNATURE-----
diff --git a/a/openbsc/src/vty_interface_layer3.c b/b/openbsc/src/vty_interface_layer3.c
index 2a31df6..ca2b287 100644
--- a/a/openbsc/src/vty_interface_layer3.c
+++ b/b/openbsc/src/vty_interface_layer3.c
@@ -394,14 +394,16 @@ 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;
+
+	name = argv_concat(argv, argc, 2);
 
 	if (!subscr) {
 		vty_out(vty, "%% No subscriber found for %s %s%s",
@@ -410,6 +412,7 @@ DEFUN(ena_subscr_name,
 	}
 
 	strncpy(subscr->name, name, sizeof(subscr->name));
+	talloc_free(name);
 	db_sync_subscriber(subscr);
 
 	subscr_put(subscr);

Reply via email to