From 29a7c9ee6fd3c353282150c6a8039473d69a7d44 Mon Sep 17 00:00:00 2001 From: Jon Schipp Date: Tue, 29 Jul 2014 20:51:08 +0000 Subject: mausezahn: provide port option to configuration file Specify the port for the CLI in /etc/netsniff-ng/mausezahn.conf like so: $ grep port /etc/netsniff-ng/mausezahn.conf port = 65000 $ mausezahn -V -x -l 127.0.0.1 Mausezahn 0.40 - (C) 2007-2010 by Herbert Haas - http://www.perihel.at/sec/mz/ Use at your own risk and responsibility! -- Verbose mode -- ... Opening config file /etc/netsniff-ng/mausezahn.conf... ... Mausezahn accepts incoming Telnet connections on 127.0.0.1:65000. Signed-off-by: Jon Schipp [tklauser: Fixed whitespace issues for patch to apply cleanly] Signed-off-by: Tobias Klauser --- staging/cli.c | 13 ++++++++++--- staging/mausezahn.c | 4 ---- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'staging') diff --git a/staging/cli.c b/staging/cli.c index 9abc648..a5ce174 100644 --- a/staging/cli.c +++ b/staging/cli.c @@ -56,7 +56,7 @@ int cli_read_cfg(char *str) char dev[256]; FILE *fd; int i, j=0, len, found=0, nonspc=0; - int user=0, pass=0, ena=0, amp=0, mgmt_only=0, cli=0; + int user=0, pass=0, ena=0, amp=0, mgmt_only=0, cli=0, port=0; strncpy(filename, str, 255); @@ -79,6 +79,7 @@ int cli_read_cfg(char *str) if (!user) user = sscanf(line, " user = %s ", mz_username); if (!pass) pass = sscanf(line, " password = %s ", mz_password); if (!ena) ena = sscanf(line, " enable = %s ", mz_enable); + if (!port) port = sscanf(line, " port = %i ", &mz_port); if (!cli) cli = sscanf(line, " cli-device = %s ", dev); if (cli==1) { for (i=0; i