Mercurial > dropbear
changeset 1894:62e4baa059c3
changed TRACE to DEBUG1 for dbclient
author | HansH111 <hans@atbas.org> |
---|---|
date | Sat, 19 Mar 2022 09:02:55 +0000 |
parents | 180e580778df |
children | 3bfacfc996cf |
files | cli-auth.c cli-authpasswd.c cli-authpubkey.c cli-main.c cli-session.c common-session.c |
diffstat | 6 files changed, 31 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/cli-auth.c Sat Mar 19 09:01:05 2022 +0000 +++ b/cli-auth.c Sat Mar 19 09:02:55 2022 +0000 @@ -85,32 +85,31 @@ banner = buf_getstring(ses.payload, &bannerlen); buf_eatstring(ses.payload); /* The language string */ - if (cli_opts.quiet == 0) { - if (bannerlen > MAX_BANNER_SIZE) { - TRACE(("recv_msg_userauth_banner: bannerlen too long: %d", bannerlen)) - truncated = 1; - } else { - cleantext(banner); + if (bannerlen > MAX_BANNER_SIZE) { + TRACE(("recv_msg_userauth_banner: bannerlen too long: %d", bannerlen)) + truncated = 1; + } else { + cleantext(banner); - /* Limit to 24 lines */ - linecount = 1; - for (i = 0; i < bannerlen; i++) { - if (banner[i] == '\n') { - if (linecount >= MAX_BANNER_LINES) { - banner[i] = '\0'; - truncated = 1; - break; - } - linecount++; + /* Limit to 24 lines */ + linecount = 1; + for (i = 0; i < bannerlen; i++) { + if (banner[i] == '\n') { + if (linecount >= MAX_BANNER_LINES) { + banner[i] = '\0'; + truncated = 1; + break; } + linecount++; } - fprintf(stderr, "%s\n", banner); } + fprintf(stderr, "%s\n", banner); + } - if (truncated) { - fprintf(stderr, "[Banner from the server is too long]\n"); - } + if (truncated) { + fprintf(stderr, "[Banner from the server is too long]\n"); } + m_free(banner); TRACE(("leave recv_msg_userauth_banner")) } @@ -261,7 +260,7 @@ /* This function can validly get called multiple times if DROPBEAR_CLI_IMMEDIATE_AUTH is set */ - TRACE(("received msg_userauth_success")) + DEBUG1(("received msg_userauth_success")) if (cli_opts.disable_trivial_auth && cli_ses.is_trivial_auth) { dropbear_exit("trivial authentication not allowed"); }
--- a/cli-authpasswd.c Sat Mar 19 09:01:05 2022 +0000 +++ b/cli-authpasswd.c Sat Mar 19 09:02:55 2022 +0000 @@ -120,7 +120,7 @@ char* password = NULL; char prompt[80]; - TRACE(("enter cli_auth_password")) + DEBUG1(("enter cli_auth_password")) CHECKCLEARTOWRITE(); snprintf(prompt, sizeof(prompt), "%s@%s's password: ",
--- a/cli-authpubkey.c Sat Mar 19 09:01:05 2022 +0000 +++ b/cli-authpubkey.c Sat Mar 19 09:02:55 2022 +0000 @@ -147,7 +147,7 @@ buffer* sigbuf = NULL; enum signkey_type keytype = signkey_type_from_signature(sigtype); - TRACE(("enter send_msg_userauth_pubkey sigtype %d", sigtype)) + DEBUG1(("enter send_msg_userauth_pubkey %s", signkey_name_from_type(sigtype,NULL))) CHECKCLEARTOWRITE(); buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST);
--- a/cli-main.c Sat Mar 19 09:01:05 2022 +0000 +++ b/cli-main.c Sat Mar 19 09:02:55 2022 +0000 @@ -65,8 +65,12 @@ } #endif - TRACE(("user='%s' host='%s' port='%s' bind_address='%s' bind_port='%s'", cli_opts.username, - cli_opts.remotehost, cli_opts.remoteport, cli_opts.bind_address, cli_opts.bind_port)) + if (cli_opts.bind_address) { + DEBUG1(("connect to: user=%s host=%s/%s bind_address=%s:%s", cli_opts.username, + cli_opts.remotehost, cli_opts.remoteport, cli_opts.bind_address, cli_opts.bind_port)) + } else { + DEBUG1(("connect to: user=%s host=%s/%s",cli_opts.username,cli_opts.remotehost,cli_opts.remoteport)) + } if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { dropbear_exit("signal() error"); @@ -135,6 +139,7 @@ ret = spawn_command(exec_proxy_cmd, ex_cmd, sock_out, sock_in, NULL, pid_out); + DEBUG1(("cmd: %s pid=%d", ex_cmd,*pid_out)) m_free(ex_cmd); if (ret == DROPBEAR_FAILURE) { dropbear_exit("Failed running proxy command");
--- a/cli-session.c Sat Mar 19 09:01:05 2022 +0000 +++ b/cli-session.c Sat Mar 19 09:02:55 2022 +0000 @@ -102,7 +102,7 @@ dropbear_exit("Connect failed: %s", errstring); } myses->sock_in = myses->sock_out = sock; - TRACE(("cli_connected")) + DEBUG1(("cli_connected")) ses.socket_prio = DROPBEAR_PRIO_NORMAL; /* switches to lowdelay */ update_channel_prio();