summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2022-03-24 14:44:13 +0800
committerMatt Johnston <matt@ucc.asn.au>2022-03-24 14:44:13 +0800
commit2bef4cc1476c7172fbdb72c2fb4f131e4f720526 (patch)
tree93f06405677572886c11b362c5543c3a595a7268
parent08efce06f113ca3f410e2c2a5f5c4163328d4010 (diff)
downloaddropbear-2bef4cc1476c7172fbdb72c2fb4f131e4f720526.tar.gz
Add -v variable debug levels for server too
-vvvv is equivalent to the old -v
-rw-r--r--debug.h2
-rw-r--r--dropbearconvert.c2
-rw-r--r--dropbearkey.c2
-rw-r--r--fuzz/fuzz-harness.c4
-rw-r--r--svr-runopts.c4
5 files changed, 8 insertions, 6 deletions
diff --git a/debug.h b/debug.h
index fcc0367..ab32fbd 100644
--- a/debug.h
+++ b/debug.h
@@ -48,6 +48,8 @@
/*#define DEBUG_KEXHASH*/
/*#define DEBUG_RSA*/
+/* The level of TRACE() statements */
+#define DROPBEAR_VERBOSE_LEVEL 4
#if DEBUG_TRACE
extern int debug_trace;
diff --git a/dropbearconvert.c b/dropbearconvert.c
index 7285f23..950608b 100644
--- a/dropbearconvert.c
+++ b/dropbearconvert.c
@@ -69,7 +69,7 @@ int main(int argc, char ** argv) {
#if DEBUG_TRACE
/* It's hard for it to get in the way _too_ much */
- debug_trace = 1;
+ debug_trace = DROPBEAR_VERBOSE_LEVEL;
#endif
/* get the commandline options */
diff --git a/dropbearkey.c b/dropbearkey.c
index 8d8c7c2..6d38901 100644
--- a/dropbearkey.c
+++ b/dropbearkey.c
@@ -195,7 +195,7 @@ int main(int argc, char ** argv) {
break;
#if DEBUG_TRACE
case 'v':
- debug_trace = 1;
+ debug_trace = DROPBEAR_VERBOSE_LEVEL;
break;
#endif
default:
diff --git a/fuzz/fuzz-harness.c b/fuzz/fuzz-harness.c
index 2c661d9..40c8366 100644
--- a/fuzz/fuzz-harness.c
+++ b/fuzz/fuzz-harness.c
@@ -12,8 +12,8 @@ int main(int argc, char ** argv) {
for (i = 1; i < argc; i++) {
#if DEBUG_TRACE
if (strcmp(argv[i], "-v") == 0) {
- debug_trace = 1;
- TRACE(("debug printing on"))
+ debug_trace++;
+ fprintf(stderr, "debug level -> %d\n", debug_trace);
}
#endif
if (strcmp(argv[i], "-q") == 0) {
diff --git a/svr-runopts.c b/svr-runopts.c
index ac43db1..301d68c 100644
--- a/svr-runopts.c
+++ b/svr-runopts.c
@@ -109,7 +109,7 @@ static void printhelp(const char * progname) {
#endif
"-V Version\n"
#if DEBUG_TRACE
- "-v verbose (compiled with DEBUG_TRACE)\n"
+ "-v verbose (repeat for more verbose)\n"
#endif
,DROPBEAR_VERSION, progname,
#if DROPBEAR_DSS
@@ -310,7 +310,7 @@ void svr_getopts(int argc, char ** argv) {
#endif
#if DEBUG_TRACE
case 'v':
- debug_trace = 1;
+ debug_trace++;
break;
#endif
case 'V':