Change in ...libosmocore[master]: vty/vty.c: the command buffer can be accessed directly

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Sat Jul 27 19:41:53 UTC 2019


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/14975


Change subject: vty/vty.c: the command buffer can be accessed directly
......................................................................

vty/vty.c: the command buffer can be accessed directly

Change-Id: Ic6d7d68e9a559a6fb5bd6eaf6eccceae51e7ed39
---
M src/vty/vty.c
1 file changed, 8 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/14975/1

diff --git a/src/vty/vty.c b/src/vty/vty.c
index 4960aea..85c9fe5 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -139,7 +139,7 @@
 }
 
 /* Authentication of vty */
-static void vty_auth(struct vty *vty, char *buf)
+static void vty_auth(struct vty *vty)
 {
 	char *passwd = NULL;
 	enum node_type next_node = 0;
@@ -173,10 +173,10 @@
 	if (passwd) {
 #ifdef VTY_CRYPT_PW
 		if (host.encrypt)
-			fail = strcmp(crypt(buf, passwd), passwd);
+			fail = strcmp(crypt(vty->buf, passwd), passwd);
 		else
 #endif
-			fail = strcmp(buf, passwd);
+			fail = strcmp(vty->buf, passwd);
 	} else
 		fail = 1;
 
@@ -420,7 +420,7 @@
 }
 
 /* Command execution over the vty interface. */
-static int vty_command(struct vty *vty, char *buf)
+static int vty_command(struct vty *vty)
 {
 	int ret;
 	vector vline;
@@ -433,11 +433,11 @@
 						   rem_port, sizeof(rem_port),
 						   false);
 		LOGP(DLGLOBAL, LOGL_DEBUG, "(%s:%s) Got VTY command: '%s'\n",
-		     rem_addr, rem_port, buf);
+		     rem_addr, rem_port, vty->buf);
 	}
 
 	/* Split readline string up into the vector */
-	vline = cmd_make_strvec(buf);
+	vline = cmd_make_strvec(vty->buf);
 
 	if (vline == NULL)
 		return CMD_SUCCESS;
@@ -706,10 +706,10 @@
 	switch (vty->node) {
 	case AUTH_NODE:
 	case AUTH_ENABLE_NODE:
-		vty_auth(vty, vty->buf);
+		vty_auth(vty);
 		break;
 	default:
-		ret = vty_command(vty, vty->buf);
+		ret = vty_command(vty);
 		if (vty->type == VTY_TERM)
 			vty_hist_add(vty);
 		break;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/14975
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic6d7d68e9a559a6fb5bd6eaf6eccceae51e7ed39
Gerrit-Change-Number: 14975
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190727/ccac057e/attachment.htm>


More information about the gerrit-log mailing list