diff --git a/mainchan.c b/mainchan.c index 2224e4fb..eb9d407c 100644 --- a/mainchan.c +++ b/mainchan.c @@ -127,7 +127,7 @@ static void mainchan_open_confirmation(Channel *chan) PacketProtocolLayer *ppl = mc->ppl; /* for ppl_logevent */ seat_update_specials_menu(mc->ppl->seat); - ppl_logevent(("Opened main channel")); + ppl_logevent("Opened main channel"); if (mc->is_simple) sshfwd_hint_channel_is_simple(mc->sc); @@ -146,8 +146,8 @@ static void mainchan_open_confirmation(Channel *chan) if ((x11disp = x11_setup_display( conf_get_str(mc->conf, CONF_x11_display), mc->conf, &x11_setup_err)) == NULL) { - ppl_logevent(("X11 forwarding not enabled: unable to" - " initialise X display: %s", x11_setup_err)); + ppl_logevent("X11 forwarding not enabled: unable to" + " initialise X display: %s", x11_setup_err); sfree(x11_setup_err); } else { x11auth = ssh_add_x11_display( @@ -178,7 +178,7 @@ static void mainchan_open_confirmation(Channel *chan) mc->n_req_env++; } if (mc->n_req_env) - ppl_logevent(("Sent %d environment variables", mc->n_req_env)); + ppl_logevent("Sent %d environment variables", mc->n_req_env); cmd = conf_get_str(mc->conf, CONF_remote_cmd); if (conf_get_bool(mc->conf, CONF_ssh_subsys)) { @@ -222,10 +222,10 @@ static void mainchan_request_response(Channel *chan, bool success) mc->req_x11 = false; if (success) { - ppl_logevent(("X11 forwarding enabled")); + ppl_logevent("X11 forwarding enabled"); ssh_enable_x_fwd(mc->cl); } else { - ppl_logevent(("X11 forwarding refused")); + ppl_logevent("X11 forwarding refused"); } return; } @@ -234,10 +234,10 @@ static void mainchan_request_response(Channel *chan, bool success) mc->req_agent = false; if (success) { - ppl_logevent(("Agent forwarding enabled")); + ppl_logevent("Agent forwarding enabled"); ssh_enable_agent_fwd(mc->cl); } else { - ppl_logevent(("Agent forwarding refused")); + ppl_logevent("Agent forwarding refused"); } return; } @@ -246,11 +246,11 @@ static void mainchan_request_response(Channel *chan, bool success) mc->req_pty = false; if (success) { - ppl_logevent(("Allocated pty")); + ppl_logevent("Allocated pty"); mc->got_pty = true; } else { - ppl_logevent(("Server refused to allocate pty")); - ppl_printf(("Server refused to allocate pty\r\n")); + ppl_logevent("Server refused to allocate pty"); + ppl_printf("Server refused to allocate pty\r\n"); ssh_set_ldisc_option(mc->cl, LD_ECHO, true); ssh_set_ldisc_option(mc->cl, LD_EDIT, true); } @@ -260,22 +260,22 @@ static void mainchan_request_response(Channel *chan, bool success) if (mc->n_env_replies < mc->n_req_env) { int j = mc->n_env_replies++; if (!success) { - ppl_logevent(("Server refused to set environment variable %s", - conf_get_str_nthstrkey(mc->conf, - CONF_environmt, j))); + ppl_logevent("Server refused to set environment variable %s", + conf_get_str_nthstrkey(mc->conf, + CONF_environmt, j)); mc->n_env_fails++; } if (mc->n_env_replies == mc->n_req_env) { if (mc->n_env_fails == 0) { - ppl_logevent(("All environment variables successfully set")); + ppl_logevent("All environment variables successfully set"); } else if (mc->n_env_fails == mc->n_req_env) { - ppl_logevent(("All environment variables refused")); - ppl_printf(("Server refused to set environment " - "variables\r\n")); + ppl_logevent("All environment variables refused"); + ppl_printf("Server refused to set environment " + "variables\r\n"); } else { - ppl_printf(("Server refused to set all environment " - "variables\r\n")); + ppl_printf("Server refused to set all environment " + "variables\r\n"); } } return; @@ -285,10 +285,10 @@ static void mainchan_request_response(Channel *chan, bool success) mc->req_cmd_primary = false; if (success) { - ppl_logevent(("Started a shell/command")); + ppl_logevent("Started a shell/command"); mainchan_ready(mc); } else if (*conf_get_str(mc->conf, CONF_remote_cmd2)) { - ppl_logevent(("Primary command failed; attempting fallback")); + ppl_logevent("Primary command failed; attempting fallback"); mainchan_try_fallback_command(mc); } else { /* @@ -305,7 +305,7 @@ static void mainchan_request_response(Channel *chan, bool success) mc->req_cmd_fallback = false; if (success) { - ppl_logevent(("Started a shell/command")); + ppl_logevent("Started a shell/command"); ssh_got_fallback_cmd(mc->ppl->ssh); mainchan_ready(mc); } else { @@ -385,7 +385,7 @@ static void mainchan_send_eof(Channel *chan) * isn't a particularly meaningful concept. */ sshfwd_write_eof(mc->sc); - ppl_logevent(("Sent EOF message")); + ppl_logevent("Sent EOF message"); mc->eof_sent = true; ssh_set_wants_user_input(mc->cl, false); /* stop reading from stdin */ } @@ -417,7 +417,7 @@ static bool mainchan_rcvd_exit_status(Channel *chan, int status) PacketProtocolLayer *ppl = mc->ppl; /* for ppl_logevent */ ssh_got_exitcode(mc->ppl->ssh, status); - ppl_logevent(("Session sent command exit status %d", status)); + ppl_logevent("Session sent command exit status %d", status); return true; } @@ -430,8 +430,8 @@ static void mainchan_log_exit_signal_common( const char *core_msg = core_dumped ? " (core dumped)" : ""; const char *msg_pre = (msg.len ? " (" : ""); const char *msg_post = (msg.len ? ")" : ""); - ppl_logevent(("Session exited on %s%s%s%.*s%s", - sigdesc, core_msg, msg_pre, PTRLEN_PRINTF(msg), msg_post)); + ppl_logevent("Session exited on %s%s%s%.*s%s", + sigdesc, core_msg, msg_pre, PTRLEN_PRINTF(msg), msg_post); } static bool mainchan_rcvd_exit_signal( @@ -544,7 +544,7 @@ void mainchan_special_cmd(mainchan *mc, SessionSpecialCode code, int arg) } else if ((signame = ssh_signal_lookup(code)) != NULL) { /* It's a signal. */ sshfwd_send_signal(mc->sc, false, signame); - ppl_logevent(("Sent signal SIG%s", signame)); + ppl_logevent("Sent signal SIG%s", signame); } } diff --git a/misc.h b/misc.h index 10c564bc..39219d62 100644 --- a/misc.h +++ b/misc.h @@ -174,7 +174,7 @@ char *buildinfo(const char *newline); * * Output goes to debug.log * - * debug(()) (note the double brackets) is like printf(). + * debug() is like printf(). * * dmemdump() and dmemdumpl() both do memory dumps. The difference * is that dmemdumpl() is more suited for when the memory address is @@ -185,11 +185,11 @@ char *buildinfo(const char *newline); #ifdef DEBUG void debug_printf(const char *fmt, ...); void debug_memdump(const void *buf, int len, bool L); -#define debug(x) (debug_printf x) +#define debug(...) (debug_printf(__VA_ARGS__)) #define dmemdump(buf,len) debug_memdump (buf, len, false); #define dmemdumpl(buf,len) debug_memdump (buf, len, true); #else -#define debug(x) +#define debug(...) #define dmemdump(buf,len) #define dmemdumpl(buf,len) #endif diff --git a/ssh1bpp.c b/ssh1bpp.c index 96f71aee..174e16f7 100644 --- a/ssh1bpp.c +++ b/ssh1bpp.c @@ -85,7 +85,7 @@ void ssh1_bpp_new_cipher(BinaryPacketProtocol *bpp, assert(!s->crcda_ctx); s->crcda_ctx = crcda_make_context(); - bpp_logevent(("Initialised %s encryption", cipher->text_name)); + bpp_logevent("Initialised %s encryption", cipher->text_name); } } @@ -101,7 +101,7 @@ void ssh1_bpp_start_compression(BinaryPacketProtocol *bpp) s->compctx = ssh_compressor_new(&ssh_zlib); s->decompctx = ssh_decompressor_new(&ssh_zlib); - bpp_logevent(("Started zlib (RFC1950) compression")); + bpp_logevent("Started zlib (RFC1950) compression"); } #define BPP_READ(ptr, len) do \ diff --git a/ssh1connection-client.c b/ssh1connection-client.c index a2c5e423..214d4482 100644 --- a/ssh1connection-client.c +++ b/ssh1connection-client.c @@ -126,7 +126,7 @@ bool ssh1_handle_direction_specific_packet( s->ppl.bpp, SSH1_MSG_CHANNEL_OPEN_FAILURE); put_uint32(pktout, remid); pq_push(s->ppl.out_pq, pktout); - ppl_logevent(("Rejected X11 connect request")); + ppl_logevent("Rejected X11 connect request"); } else { c = snew(struct ssh1_channel); c->connlayer = s; @@ -142,7 +142,7 @@ bool ssh1_handle_direction_specific_packet( put_uint32(pktout, c->remoteid); put_uint32(pktout, c->localid); pq_push(s->ppl.out_pq, pktout); - ppl_logevent(("Opened X11 forward channel")); + ppl_logevent("Opened X11 forward channel"); } return true; @@ -183,8 +183,8 @@ bool ssh1_handle_direction_specific_packet( pfp = find234(s->rportfwds, &pf, NULL); if (!pfp) { - ppl_logevent(("Rejected remote port open request for %s:%d", - pf.dhost, port)); + ppl_logevent("Rejected remote port open request for %s:%d", + pf.dhost, port); pktout = ssh_bpp_new_pktout( s->ppl.bpp, SSH1_MSG_CHANNEL_OPEN_FAILURE); put_uint32(pktout, remid); @@ -194,14 +194,14 @@ bool ssh1_handle_direction_specific_packet( c = snew(struct ssh1_channel); c->connlayer = s; - ppl_logevent(("Received remote port open request for %s:%d", - pf.dhost, port)); + ppl_logevent("Received remote port open request for %s:%d", + pf.dhost, port); err = portfwdmgr_connect( s->portfwdmgr, &c->chan, pf.dhost, port, &c->sc, pfp->addressfamily); if (err) { - ppl_logevent(("Port open failed: %s", err)); + ppl_logevent("Port open failed: %s", err); sfree(err); ssh1_channel_free(c); pktout = ssh_bpp_new_pktout( @@ -217,7 +217,7 @@ bool ssh1_handle_direction_specific_packet( put_uint32(pktout, c->remoteid); put_uint32(pktout, c->localid); pq_push(s->ppl.out_pq, pktout); - ppl_logevent(("Forwarded port opened successfully")); + ppl_logevent("Forwarded port opened successfully"); } } @@ -243,7 +243,7 @@ bool ssh1_handle_direction_specific_packet( case SSH1_SMSG_EXIT_STATUS: { int exitcode = get_uint32(pktin); - ppl_logevent(("Server sent command exit status %d", exitcode)); + ppl_logevent("Server sent command exit status %d", exitcode); ssh_got_exitcode(s->ppl.ssh, exitcode); s->session_terminated = true; @@ -468,11 +468,11 @@ static void ssh1_rportfwd_response(struct ssh1_connection_state *s, struct ssh_rportfwd *rpf = (struct ssh_rportfwd *)ctx; if (success) { - ppl_logevent(("Remote port forwarding from %s enabled", - rpf->log_description)); + ppl_logevent("Remote port forwarding from %s enabled", + rpf->log_description); } else { - ppl_logevent(("Remote port forwarding from %s refused", - rpf->log_description)); + ppl_logevent("Remote port forwarding from %s refused", + rpf->log_description); struct ssh_rportfwd *realpf = del234(s->rportfwds, rpf); assert(realpf == rpf); diff --git a/ssh1connection-server.c b/ssh1connection-server.c index bdbec47e..92e1ec99 100644 --- a/ssh1connection-server.c +++ b/ssh1connection-server.c @@ -72,7 +72,7 @@ bool ssh1_handle_direction_specific_packet( if (s->finished_setup) goto unexpected_setup_packet; - ppl_logevent(("Client requested a shell")); + ppl_logevent("Client requested a shell"); chan_run_shell(s->mainchan_chan); s->finished_setup = true; return true; @@ -82,7 +82,7 @@ bool ssh1_handle_direction_specific_packet( goto unexpected_setup_packet; cmd = get_string(pktin); - ppl_logevent(("Client sent command '%.*s'", PTRLEN_PRINTF(cmd))); + ppl_logevent("Client sent command '%.*s'", PTRLEN_PRINTF(cmd)); chan_run_command(s->mainchan_chan, cmd); s->finished_setup = true; return true; @@ -119,12 +119,12 @@ bool ssh1_handle_direction_specific_packet( BinarySource_UPCAST(pktin), 1); if (get_err(pktin)) { - ppl_logevent(("Unable to decode pty request packet")); + ppl_logevent("Unable to decode pty request packet"); success = false; } else if (!chan_allocate_pty( s->mainchan_chan, termtype, width, height, pixwidth, pixheight, modes)) { - ppl_logevent(("Unable to allocate a pty")); + ppl_logevent("Unable to allocate a pty"); success = false; } else { success = true; @@ -144,8 +144,8 @@ bool ssh1_handle_direction_specific_packet( host = get_string(pktin); port = toint(get_uint32(pktin)); - ppl_logevent(("Client requested port %d forward to %.*s:%d", - listenport, PTRLEN_PRINTF(host), port)); + ppl_logevent("Client requested port %d forward to %.*s:%d", + listenport, PTRLEN_PRINTF(host), port); host_str = mkstr(host); success = portfwdmgr_listen( @@ -207,8 +207,8 @@ bool ssh1_handle_direction_specific_packet( host_str = mkstr(host); - ppl_logevent(("Received request to connect to port %s:%d", - host_str, port)); + ppl_logevent("Received request to connect to port %s:%d", + host_str, port); c = snew(struct ssh1_channel); c->connlayer = s; err = portfwdmgr_connect( @@ -218,7 +218,7 @@ bool ssh1_handle_direction_specific_packet( sfree(host_str); if (err) { - ppl_logevent(("Port open failed: %s", err)); + ppl_logevent("Port open failed: %s", err); sfree(err); ssh1_channel_free(c); pktout = ssh_bpp_new_pktout( @@ -234,7 +234,7 @@ bool ssh1_handle_direction_specific_packet( put_uint32(pktout, c->remoteid); put_uint32(pktout, c->localid); pq_push(s->ppl.out_pq, pktout); - ppl_logevent(("Forwarded port opened successfully")); + ppl_logevent("Forwarded port opened successfully"); } return true; @@ -325,7 +325,7 @@ SshChannel *ssh1_serverside_x11_open( c->halfopen = true; c->chan = chan; - ppl_logevent(("Forwarding X11 connection to client")); + ppl_logevent("Forwarding X11 connection to client"); pktout = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_SMSG_X11_OPEN); put_uint32(pktout, c->localid); @@ -347,7 +347,7 @@ SshChannel *ssh1_serverside_agent_open(ConnectionLayer *cl, Channel *chan) c->halfopen = true; c->chan = chan; - ppl_logevent(("Forwarding agent connection to client")); + ppl_logevent("Forwarding agent connection to client"); pktout = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_SMSG_AGENT_OPEN); put_uint32(pktout, c->localid); diff --git a/ssh1connection.c b/ssh1connection.c index 4d43299c..fb3fe93f 100644 --- a/ssh1connection.c +++ b/ssh1connection.c @@ -482,7 +482,7 @@ static void ssh1_channel_close_local(struct ssh1_channel *c, const char *msg = chan_log_close_msg(c->chan); if (msg != NULL) - ppl_logevent(("%s%s%s", msg, reason ? " " : "", reason ? reason : "")); + ppl_logevent("%s%s%s", msg, reason ? " " : "", reason ? reason : ""); chan_free(c->chan); c->chan = zombiechan_new(); @@ -637,8 +637,8 @@ static SshChannel *ssh1_lportfwd_open( c->halfopen = true; c->chan = chan; - ppl_logevent(("Opening connection to %s:%d for %s", - hostname, port, description)); + ppl_logevent("Opening connection to %s:%d for %s", + hostname, port, description); pktout = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_MSG_PORT_OPEN); put_uint32(pktout, c->localid); diff --git a/ssh1login-server.c b/ssh1login-server.c index 6689bf64..1dd374a7 100644 --- a/ssh1login-server.c +++ b/ssh1login-server.c @@ -258,7 +258,7 @@ static void ssh1_login_server_process_queue(PacketProtocolLayer *ppl) } s->username = get_string(pktin); s->username.ptr = s->username_str = mkstr(s->username); - ppl_logevent(("Received username '%.*s'", PTRLEN_PRINTF(s->username))); + ppl_logevent("Received username '%.*s'", PTRLEN_PRINTF(s->username)); s->auth_successful = auth_none(s->authpolicy, s->username); while (1) { @@ -298,7 +298,7 @@ static void ssh1_login_server_process_queue(PacketProtocolLayer *ppl) continue; if (s->authkey->bytes < 32) { - ppl_logevent(("Auth key far too small")); + ppl_logevent("Auth key far too small"); continue; } @@ -317,7 +317,7 @@ static void ssh1_login_server_process_queue(PacketProtocolLayer *ppl) if (!rsa_ssh1_encrypt(rsabuf, 32, s->authkey)) { sfree(rsabuf); - ppl_logevent(("Failed to encrypt auth challenge")); + ppl_logevent("Failed to encrypt auth challenge"); continue; } @@ -346,7 +346,7 @@ static void ssh1_login_server_process_queue(PacketProtocolLayer *ppl) ptrlen expected = make_ptrlen( s->auth_rsa_expected_response, 16); if (!ptrlen_eq_ptrlen(response, expected)) { - ppl_logevent(("Wrong response to auth challenge")); + ppl_logevent("Wrong response to auth challenge"); continue; } } diff --git a/ssh1login.c b/ssh1login.c index a85209a3..dcd256e2 100644 --- a/ssh1login.c +++ b/ssh1login.c @@ -157,7 +157,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) return; } - ppl_logevent(("Received public keys")); + ppl_logevent("Received public keys"); { ptrlen pl = get_data(pktin, 8); @@ -174,8 +174,8 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) */ if (!get_err(pktin)) { char *fingerprint = rsa_ssh1_fingerprint(&s->hostkey); - ppl_logevent(("Host key fingerprint is:")); - ppl_logevent((" %s", fingerprint)); + ppl_logevent("Host key fingerprint is:"); + ppl_logevent(" %s", fingerprint); sfree(fingerprint); } @@ -276,7 +276,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) } } - ppl_logevent(("Encrypted session key")); + ppl_logevent("Encrypted session key"); { bool cipher_chosen = false, warn = false; @@ -290,7 +290,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) warn = true; } else if (next_cipher == CIPHER_AES) { /* XXX Probably don't need to mention this. */ - ppl_logevent(("AES not supported in SSH-1, skipping")); + ppl_logevent("AES not supported in SSH-1, skipping"); } else { switch (next_cipher) { case CIPHER_3DES: s->cipher_type = SSH_CIPHER_3DES; @@ -330,13 +330,13 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) switch (s->cipher_type) { case SSH_CIPHER_3DES: - ppl_logevent(("Using 3DES encryption")); + ppl_logevent("Using 3DES encryption"); break; case SSH_CIPHER_DES: - ppl_logevent(("Using single-DES encryption")); + ppl_logevent("Using single-DES encryption"); break; case SSH_CIPHER_BLOWFISH: - ppl_logevent(("Using Blowfish encryption")); + ppl_logevent("Using Blowfish encryption"); break; } @@ -348,7 +348,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) put_uint32(pkt, s->local_protoflags); pq_push(s->ppl.out_pq, pkt); - ppl_logevent(("Trying to enable encryption...")); + ppl_logevent("Trying to enable encryption..."); sfree(s->rsabuf); s->rsabuf = NULL; @@ -390,7 +390,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) return; } - ppl_logevent(("Successfully started encryption")); + ppl_logevent("Successfully started encryption"); if ((s->username = get_remote_username(s->conf)) == NULL) { s->cur_prompt = new_prompts(); @@ -428,9 +428,9 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) put_stringz(pkt, s->username); pq_push(s->ppl.out_pq, pkt); - ppl_logevent(("Sent username \"%s\"", s->username)); + ppl_logevent("Sent username \"%s\"", s->username); if ((flags & FLAG_VERBOSE) || (flags & FLAG_INTERACTIVE)) - ppl_printf(("Sent username \"%s\"\r\n", s->username)); + ppl_printf("Sent username \"%s\"\r\n", s->username); crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) != NULL); @@ -448,8 +448,8 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) s->keyfile = conf_get_filename(s->conf, CONF_keyfile); if (!filename_is_null(s->keyfile)) { int keytype; - ppl_logevent(("Reading key file \"%.150s\"", - filename_to_str(s->keyfile))); + ppl_logevent("Reading key file \"%.150s\"", + filename_to_str(s->keyfile)); keytype = key_type(s->keyfile); if (keytype == SSH_KEYTYPE_SSH1 || keytype == SSH_KEYTYPE_SSH1_PUBLIC) { @@ -460,22 +460,22 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) &s->publickey_comment, &error)) { s->privatekey_available = (keytype == SSH_KEYTYPE_SSH1); if (!s->privatekey_available) - ppl_logevent(("Key file contains public key only")); + ppl_logevent("Key file contains public key only"); s->privatekey_encrypted = rsa_ssh1_encrypted(s->keyfile, NULL); } else { - ppl_logevent(("Unable to load key (%s)", error)); - ppl_printf(("Unable to load key file \"%s\" (%s)\r\n", - filename_to_str(s->keyfile), error)); + ppl_logevent("Unable to load key (%s)", error); + ppl_printf("Unable to load key file \"%s\" (%s)\r\n", + filename_to_str(s->keyfile), error); strbuf_free(s->publickey_blob); s->publickey_blob = NULL; } } else { - ppl_logevent(("Unable to use this key file (%s)", - key_type_to_str(keytype))); - ppl_printf(("Unable to use key file \"%s\" (%s)\r\n", - filename_to_str(s->keyfile), - key_type_to_str(keytype))); + ppl_logevent("Unable to use this key file (%s)", + key_type_to_str(keytype)); + ppl_printf("Unable to use key file \"%s\" (%s)\r\n", + filename_to_str(s->keyfile), + key_type_to_str(keytype)); } } @@ -493,7 +493,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) */ s->authed = false; s->tried_agent = true; - ppl_logevent(("Pageant is running. Requesting keys.")); + ppl_logevent("Pageant is running. Requesting keys."); /* Request the keys held by the agent. */ { @@ -510,11 +510,11 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) if (get_byte(s->asrc) == SSH1_AGENT_RSA_IDENTITIES_ANSWER) { s->nkeys = toint(get_uint32(s->asrc)); if (s->nkeys < 0) { - ppl_logevent(("Pageant reported negative key count %d", - s->nkeys)); + ppl_logevent("Pageant reported negative key count %d", + s->nkeys); s->nkeys = 0; } - ppl_logevent(("Pageant has %d SSH-1 keys", s->nkeys)); + ppl_logevent("Pageant has %d SSH-1 keys", s->nkeys); for (s->keyi = 0; s->keyi < s->nkeys; s->keyi++) { size_t start, end; start = s->asrc->pos; @@ -523,7 +523,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) end = s->asrc->pos; s->comment = get_string(s->asrc); if (get_err(s->asrc)) { - ppl_logevent(("Pageant key list packet was truncated")); + ppl_logevent("Pageant key list packet was truncated"); break; } if (s->publickey_blob) { @@ -533,24 +533,24 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) if (keystr.len == s->publickey_blob->len && !memcmp(keystr.ptr, s->publickey_blob->s, s->publickey_blob->len)) { - ppl_logevent(("Pageant key #%d matches " - "configured key file", s->keyi)); + ppl_logevent("Pageant key #%d matches " + "configured key file", s->keyi); s->tried_publickey = true; } else /* Skip non-configured key */ continue; } - ppl_logevent(("Trying Pageant key #%d", s->keyi)); + ppl_logevent("Trying Pageant key #%d", s->keyi); pkt = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_CMSG_AUTH_RSA); put_mp_ssh1(pkt, s->key.modulus); pq_push(s->ppl.out_pq, pkt); crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) != NULL); if (pktin->type != SSH1_SMSG_AUTH_RSA_CHALLENGE) { - ppl_logevent(("Key refused")); + ppl_logevent("Key refused"); continue; } - ppl_logevent(("Received RSA challenge")); + ppl_logevent("Received RSA challenge"); s->challenge = get_mp_ssh1(pktin); if (get_err(pktin)) { freebn(s->challenge); @@ -579,7 +579,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) if (ret) { if (s->agent_response.len >= 5+16 && ret[4] == SSH1_AGENT_RSA_RESPONSE) { - ppl_logevent(("Sending Pageant's response")); + ppl_logevent("Sending Pageant's response"); pkt = ssh_bpp_new_pktout( s->ppl.bpp, SSH1_CMSG_AUTH_RSA_RESPONSE); put_data(pkt, ret + 5, 16); @@ -589,25 +589,25 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) (pktin = ssh1_login_pop(s)) != NULL); if (pktin->type == SSH1_SMSG_SUCCESS) { - ppl_logevent(("Pageant's response " - "accepted")); + ppl_logevent("Pageant's response " + "accepted"); if (flags & FLAG_VERBOSE) { - ppl_printf(("Authenticated using RSA " - "key \"%.*s\" from " - "agent\r\n", PTRLEN_PRINTF( - s->comment))); + ppl_printf("Authenticated using RSA " + "key \"%.*s\" from " + "agent\r\n", PTRLEN_PRINTF( + s->comment)); } s->authed = true; } else - ppl_logevent(("Pageant's response not " - "accepted")); + ppl_logevent("Pageant's response not " + "accepted"); } else { - ppl_logevent(("Pageant failed to answer " - "challenge")); + ppl_logevent("Pageant failed to answer " + "challenge"); sfree((char *)ret); } } else { - ppl_logevent(("No reply received from Pageant")); + ppl_logevent("No reply received from Pageant"); } } freebn(s->key.exponent); @@ -619,9 +619,9 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) sfree(s->agent_response_to_free); s->agent_response_to_free = NULL; if (s->publickey_blob && !s->tried_publickey) - ppl_logevent(("Configured key file not in Pageant")); + ppl_logevent("Configured key file not in Pageant"); } else { - ppl_logevent(("Failed to get reply from Pageant")); + ppl_logevent("Failed to get reply from Pageant"); } if (s->authed) break; @@ -634,9 +634,9 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) */ bool got_passphrase; /* need not be kept over crReturn */ if (flags & FLAG_VERBOSE) - ppl_printf(("Trying public key authentication.\r\n")); - ppl_logevent(("Trying public key \"%s\"", - filename_to_str(s->keyfile))); + ppl_printf("Trying public key authentication.\r\n"); + ppl_logevent("Trying public key \"%s\"", + filename_to_str(s->keyfile)); s->tried_publickey = true; got_passphrase = false; while (!got_passphrase) { @@ -648,7 +648,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) const char *error; if (!s->privatekey_encrypted) { if (flags & FLAG_VERBOSE) - ppl_printf(("No passphrase required.\r\n")); + ppl_printf("No passphrase required.\r\n"); passphrase = NULL; } else { s->cur_prompt = new_prompts(s->ppl.seat); @@ -695,12 +695,12 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) /* Correct passphrase. */ got_passphrase = true; } else if (retd == 0) { - ppl_printf(("Couldn't load private key from %s (%s).\r\n", - filename_to_str(s->keyfile), error)); + ppl_printf("Couldn't load private key from %s (%s).\r\n", + filename_to_str(s->keyfile), error); got_passphrase = false; break; /* go and try something else */ } else if (retd == -1) { - ppl_printf(("Wrong passphrase.\r\n")); + ppl_printf("Wrong passphrase.\r\n"); got_passphrase = false; /* and try again */ } else { @@ -721,7 +721,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) != NULL); if (pktin->type == SSH1_SMSG_FAILURE) { - ppl_printf(("Server refused our public key.\r\n")); + ppl_printf("Server refused our public key.\r\n"); continue; /* go and try something else */ } if (pktin->type != SSH1_SMSG_AUTH_RSA_CHALLENGE) { @@ -772,8 +772,8 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) != NULL); if (pktin->type == SSH1_SMSG_FAILURE) { if (flags & FLAG_VERBOSE) - ppl_printf(("Failed to authenticate with" - " our public key.\r\n")); + ppl_printf("Failed to authenticate with" + " our public key.\r\n"); continue; /* go and try something else */ } else if (pktin->type != SSH1_SMSG_SUCCESS) { ssh_proto_error(s->ppl.ssh, "Received unexpected packet" @@ -797,14 +797,14 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) (s->supported_auths_mask & (1 << SSH1_AUTH_TIS)) && !s->tis_auth_refused) { s->pwpkt_type = SSH1_CMSG_AUTH_TIS_RESPONSE; - ppl_logevent(("Requested TIS authentication")); + ppl_logevent("Requested TIS authentication"); pkt = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_CMSG_AUTH_TIS); pq_push(s->ppl.out_pq, pkt); crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) != NULL); if (pktin->type == SSH1_SMSG_FAILURE) { - ppl_logevent(("TIS authentication declined")); + ppl_logevent("TIS authentication declined"); if (flags & FLAG_INTERACTIVE) - ppl_printf(("TIS authentication refused.\r\n")); + ppl_printf("TIS authentication refused.\r\n"); s->tis_auth_refused = true; continue; } else if (pktin->type == SSH1_SMSG_AUTH_TIS_CHALLENGE) { @@ -817,7 +817,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) "badly formed"); return; } - ppl_logevent(("Received TIS challenge")); + ppl_logevent("Received TIS challenge"); s->cur_prompt->to_server = true; s->cur_prompt->name = dupstr("SSH TIS authentication"); /* Prompt heuristic comes from OpenSSH */ @@ -846,13 +846,13 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) (s->supported_auths_mask & (1 << SSH1_AUTH_CCARD)) && !s->ccard_auth_refused) { s->pwpkt_type = SSH1_CMSG_AUTH_CCARD_RESPONSE; - ppl_logevent(("Requested CryptoCard authentication")); + ppl_logevent("Requested CryptoCard authentication"); pkt = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_CMSG_AUTH_CCARD); pq_push(s->ppl.out_pq, pkt); crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) != NULL); if (pktin->type == SSH1_SMSG_FAILURE) { - ppl_logevent(("CryptoCard authentication declined")); - ppl_printf(("CryptoCard authentication refused.\r\n")); + ppl_logevent("CryptoCard authentication declined"); + ppl_printf("CryptoCard authentication refused.\r\n"); s->ccard_auth_refused = true; continue; } else if (pktin->type == SSH1_SMSG_AUTH_CCARD_CHALLENGE) { @@ -865,7 +865,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) "was badly formed"); return; } - ppl_logevent(("Received CryptoCard challenge")); + ppl_logevent("Received CryptoCard challenge"); s->cur_prompt->to_server = true; s->cur_prompt->name = dupstr("SSH CryptoCard authentication"); s->cur_prompt->name_reqd = false; @@ -1008,7 +1008,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) pq_push(s->ppl.out_pq, pkt); } } - ppl_logevent(("Sending password with camouflage packets")); + ppl_logevent("Sending password with camouflage packets"); } else if (!(s->ppl.remote_bugs & BUG_NEEDS_SSH1_PLAIN_PASSWORD)) { /* @@ -1018,7 +1018,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) */ strbuf *padded_pw = strbuf_new(); - ppl_logevent(("Sending length-padded password")); + ppl_logevent("Sending length-padded password"); pkt = ssh_bpp_new_pktout(s->ppl.bpp, s->pwpkt_type); put_asciz(padded_pw, s->cur_prompt->prompts[0]->result); do { @@ -1031,7 +1031,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) * The server is believed unable to cope with * any of our password camouflage methods. */ - ppl_logevent(("Sending unpadded password")); + ppl_logevent("Sending unpadded password"); pkt = ssh_bpp_new_pktout(s->ppl.bpp, s->pwpkt_type); put_stringz(pkt, s->cur_prompt->prompts[0]->result); pq_push(s->ppl.out_pq, pkt); @@ -1041,14 +1041,14 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) put_stringz(pkt, s->cur_prompt->prompts[0]->result); pq_push(s->ppl.out_pq, pkt); } - ppl_logevent(("Sent password")); + ppl_logevent("Sent password"); free_prompts(s->cur_prompt); s->cur_prompt = NULL; crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) != NULL); if (pktin->type == SSH1_SMSG_FAILURE) { if (flags & FLAG_VERBOSE) - ppl_printf(("Access denied\r\n")); - ppl_logevent(("Authentication refused")); + ppl_printf("Access denied\r\n"); + ppl_logevent("Authentication refused"); } else if (pktin->type != SSH1_SMSG_SUCCESS) { ssh_proto_error(s->ppl.ssh, "Received unexpected packet" " in response to password authentication, type %d " @@ -1057,10 +1057,10 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) } } - ppl_logevent(("Authentication successful")); + ppl_logevent("Authentication successful"); if (conf_get_bool(s->conf, CONF_compression)) { - ppl_logevent(("Requesting compression")); + ppl_logevent("Requesting compression"); pkt = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_CMSG_REQUEST_COMPRESSION); put_uint32(pkt, 6); /* gzip compression level */ pq_push(s->ppl.out_pq, pkt); @@ -1075,8 +1075,8 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) * cross in transit.) */ } else if (pktin->type == SSH1_SMSG_FAILURE) { - ppl_logevent(("Server refused to enable compression")); - ppl_printf(("Server refused to compress\r\n")); + ppl_logevent("Server refused to enable compression"); + ppl_printf("Server refused to compress\r\n"); } else { ssh_proto_error(s->ppl.ssh, "Received unexpected packet" " in response to compression request, type %d " diff --git a/ssh2bpp.c b/ssh2bpp.c index b1d454c3..d9025c3a 100644 --- a/ssh2bpp.c +++ b/ssh2bpp.c @@ -113,8 +113,8 @@ void ssh2_bpp_new_outgoing_crypto( (ssh2_cipher_alg(s->out.cipher)->flags & SSH_CIPHER_IS_CBC) && !(s->bpp.remote_bugs & BUG_CHOKES_ON_SSH2_IGNORE)); - bpp_logevent(("Initialised %.200s outbound encryption", - ssh2_cipher_alg(s->out.cipher)->text_name)); + bpp_logevent("Initialised %.200s outbound encryption", + ssh2_cipher_alg(s->out.cipher)->text_name); } else { s->out.cipher = NULL; s->cbc_ignore_workaround = false; @@ -124,12 +124,12 @@ void ssh2_bpp_new_outgoing_crypto( s->out.mac = ssh2_mac_new(mac, s->out.cipher); mac->setkey(s->out.mac, mac_key); - bpp_logevent(("Initialised %.200s outbound MAC algorithm%s%s", - ssh2_mac_alg(s->out.mac)->text_name, - etm_mode ? " (in ETM mode)" : "", - (s->out.cipher && - ssh2_cipher_alg(s->out.cipher)->required_mac ? - " (required by cipher)" : ""))); + bpp_logevent("Initialised %.200s outbound MAC algorithm%s%s", + ssh2_mac_alg(s->out.mac)->text_name, + etm_mode ? " (in ETM mode)" : "", + (s->out.cipher && + ssh2_cipher_alg(s->out.cipher)->required_mac ? + " (required by cipher)" : "")); } else { s->out.mac = NULL; } @@ -138,8 +138,8 @@ void ssh2_bpp_new_outgoing_crypto( s->out.pending_compression = compression; s->out_comp = NULL; - bpp_logevent(("Will enable %s compression after user authentication", - s->out.pending_compression->text_name)); + bpp_logevent("Will enable %s compression after user authentication", + s->out.pending_compression->text_name); } else { s->out.pending_compression = NULL; @@ -149,8 +149,8 @@ void ssh2_bpp_new_outgoing_crypto( s->out_comp = ssh_compressor_new(compression); if (s->out_comp) - bpp_logevent(("Initialised %s compression", - ssh_compressor_alg(s->out_comp)->text_name)); + bpp_logevent("Initialised %s compression", + ssh_compressor_alg(s->out_comp)->text_name); } } @@ -176,8 +176,8 @@ void ssh2_bpp_new_incoming_crypto( ssh2_cipher_setkey(s->in.cipher, ckey); ssh2_cipher_setiv(s->in.cipher, iv); - bpp_logevent(("Initialised %.200s inbound encryption", - ssh2_cipher_alg(s->in.cipher)->text_name)); + bpp_logevent("Initialised %.200s inbound encryption", + ssh2_cipher_alg(s->in.cipher)->text_name); } else { s->in.cipher = NULL; } @@ -186,12 +186,12 @@ void ssh2_bpp_new_incoming_crypto( s->in.mac = ssh2_mac_new(mac, s->in.cipher); mac->setkey(s->in.mac, mac_key); - bpp_logevent(("Initialised %.200s inbound MAC algorithm%s%s", - ssh2_mac_alg(s->in.mac)->text_name, - etm_mode ? " (in ETM mode)" : "", - (s->in.cipher && - ssh2_cipher_alg(s->in.cipher)->required_mac ? - " (required by cipher)" : ""))); + bpp_logevent("Initialised %.200s inbound MAC algorithm%s%s", + ssh2_mac_alg(s->in.mac)->text_name, + etm_mode ? " (in ETM mode)" : "", + (s->in.cipher && + ssh2_cipher_alg(s->in.cipher)->required_mac ? + " (required by cipher)" : "")); } else { s->in.mac = NULL; } @@ -200,8 +200,8 @@ void ssh2_bpp_new_incoming_crypto( s->in.pending_compression = compression; s->in_decomp = NULL; - bpp_logevent(("Will enable %s decompression after user authentication", - s->in.pending_compression->text_name)); + bpp_logevent("Will enable %s decompression after user authentication", + s->in.pending_compression->text_name); } else { s->in.pending_compression = NULL; @@ -211,8 +211,8 @@ void ssh2_bpp_new_incoming_crypto( s->in_decomp = ssh_decompressor_new(compression); if (s->in_decomp) - bpp_logevent(("Initialised %s decompression", - ssh_decompressor_alg(s->in_decomp)->text_name)); + bpp_logevent("Initialised %s decompression", + ssh_decompressor_alg(s->in_decomp)->text_name); } /* Clear the pending_newkeys flag, so that handle_input below will @@ -239,14 +239,14 @@ static void ssh2_bpp_enable_pending_compression(struct ssh2_bpp_state *s) if (s->in.pending_compression) { s->in_decomp = ssh_decompressor_new(s->in.pending_compression); - bpp_logevent(("Initialised delayed %s decompression", - ssh_decompressor_alg(s->in_decomp)->text_name)); + bpp_logevent("Initialised delayed %s decompression", + ssh_decompressor_alg(s->in_decomp)->text_name); s->in.pending_compression = NULL; } if (s->out.pending_compression) { s->out_comp = ssh_compressor_new(s->out.pending_compression); - bpp_logevent(("Initialised delayed %s compression", - ssh_compressor_alg(s->out_comp)->text_name)); + bpp_logevent("Initialised delayed %s compression", + ssh_compressor_alg(s->out_comp)->text_name); s->out.pending_compression = NULL; } } diff --git a/ssh2connection-client.c b/ssh2connection-client.c index d332c677..3853ac97 100644 --- a/ssh2connection-client.c +++ b/ssh2connection-client.c @@ -20,8 +20,8 @@ static ChanopenResult chan_open_x11( char *peeraddr_str; Channel *ch; - ppl_logevent(("Received X11 connect request from %.*s:%d", - PTRLEN_PRINTF(peeraddr), peerport)); + ppl_logevent("Received X11 connect request from %.*s:%d", + PTRLEN_PRINTF(peeraddr), peerport); if (!s->X11_fwd_enabled && !s->connshare) { CHANOPEN_RETURN_FAILURE( @@ -33,7 +33,7 @@ static ChanopenResult chan_open_x11( ch = x11_new_channel( s->x11authtree, sc, peeraddr_str, peerport, s->connshare != NULL); sfree(peeraddr_str); - ppl_logevent(("Opened X11 forward channel")); + ppl_logevent("Opened X11 forward channel"); CHANOPEN_RETURN_SUCCESS(ch); } @@ -46,9 +46,9 @@ static ChanopenResult chan_open_forwarded_tcpip( Channel *ch; char *err; - ppl_logevent(("Received remote port %.*s:%d open request from %.*s:%d", - PTRLEN_PRINTF(fwdaddr), fwdport, - PTRLEN_PRINTF(peeraddr), peerport)); + ppl_logevent("Received remote port %.*s:%d open request from %.*s:%d", + PTRLEN_PRINTF(fwdaddr), fwdport, + PTRLEN_PRINTF(peeraddr), peerport); pf.shost = mkstr(fwdaddr); pf.sport = fwdport; @@ -72,17 +72,17 @@ static ChanopenResult chan_open_forwarded_tcpip( err = portfwdmgr_connect( s->portfwdmgr, &ch, realpf->dhost, realpf->dport, sc, realpf->addressfamily); - ppl_logevent(("Attempting to forward remote port to %s:%d", - realpf->dhost, realpf->dport)); + ppl_logevent("Attempting to forward remote port to %s:%d", + realpf->dhost, realpf->dport); if (err != NULL) { - ppl_logevent(("Port open failed: %s", err)); + ppl_logevent("Port open failed: %s", err); sfree(err); CHANOPEN_RETURN_FAILURE( SSH2_OPEN_CONNECT_FAILED, ("Port open failed")); } - ppl_logevent(("Forwarded port opened successfully")); + ppl_logevent("Forwarded port opened successfully"); CHANOPEN_RETURN_SUCCESS(ch); } @@ -150,8 +150,8 @@ PktOut *ssh2_portfwd_chanopen( * connect _to_. */ - ppl_logevent(("Opening connection to %s:%d for %s", - hostname, port, description)); + ppl_logevent("Opening connection to %s:%d for %s", + hostname, port, description); pktout = ssh2_chanopen_init(c, "direct-tcpip"); { @@ -196,11 +196,11 @@ static void ssh2_rportfwd_globreq_response(struct ssh2_connection_state *s, struct ssh_rportfwd *rpf = (struct ssh_rportfwd *)ctx; if (pktin->type == SSH2_MSG_REQUEST_SUCCESS) { - ppl_logevent(("Remote port forwarding from %s enabled", - rpf->log_description)); + ppl_logevent("Remote port forwarding from %s enabled", + rpf->log_description); } else { - ppl_logevent(("Remote port forwarding from %s refused", - rpf->log_description)); + ppl_logevent("Remote port forwarding from %s refused", + rpf->log_description); struct ssh_rportfwd *realpf = del234(s->rportfwds, rpf); assert(realpf == rpf); @@ -293,7 +293,7 @@ SshChannel *ssh2_session_open(ConnectionLayer *cl, Channel *chan) c->halfopen = true; c->chan = chan; - ppl_logevent(("Opening main session channel")); + ppl_logevent("Opening main session channel"); pktout = ssh2_chanopen_init(c, "session"); pq_push(s->ppl.out_pq, pktout); diff --git a/ssh2connection-server.c b/ssh2connection-server.c index 7cd7441a..c68e36f7 100644 --- a/ssh2connection-server.c +++ b/ssh2connection-server.c @@ -26,7 +26,7 @@ static ChanopenResult chan_open_session( { PacketProtocolLayer *ppl = &s->ppl; /* for ppl_logevent */ - ppl_logevent(("Opened session channel")); + ppl_logevent("Opened session channel"); CHANOPEN_RETURN_SUCCESS(sesschan_new(sc, s->ppl.logctx, s->sftpserver_vt)); } @@ -41,21 +41,21 @@ static ChanopenResult chan_open_direct_tcpip( dstaddr_str = mkstr(dstaddr); - ppl_logevent(("Received request to connect to port %s:%d (from %.*s:%d)", - dstaddr_str, dstport, PTRLEN_PRINTF(peeraddr), peerport)); + ppl_logevent("Received request to connect to port %s:%d (from %.*s:%d)", + dstaddr_str, dstport, PTRLEN_PRINTF(peeraddr), peerport); err = portfwdmgr_connect( s->portfwdmgr, &ch, dstaddr_str, dstport, sc, ADDRTYPE_UNSPEC); sfree(dstaddr_str); if (err != NULL) { - ppl_logevent(("Port open failed: %s", err)); + ppl_logevent("Port open failed: %s", err); sfree(err); CHANOPEN_RETURN_FAILURE( SSH2_OPEN_CONNECT_FAILED, ("Connection failed")); } - ppl_logevent(("Port opened successfully")); + ppl_logevent("Port opened successfully"); CHANOPEN_RETURN_SUCCESS(ch); } @@ -121,11 +121,11 @@ PktOut *ssh2_portfwd_chanopen( */ if (pi && pi->log_text) - ppl_logevent(("Forwarding connection to listening port %s:%d from %s", - hostname, port, pi->log_text)); + ppl_logevent("Forwarding connection to listening port %s:%d from %s", + hostname, port, pi->log_text); else - ppl_logevent(("Forwarding connection to listening port %s:%d", - hostname, port)); + ppl_logevent("Forwarding connection to listening port %s:%d", + hostname, port); pktout = ssh2_chanopen_init(c, "forwarded-tcpip"); put_stringz(pktout, hostname); @@ -169,7 +169,7 @@ SshChannel *ssh2_serverside_x11_open( c->halfopen = true; c->chan = chan; - ppl_logevent(("Forwarding X11 channel to client")); + ppl_logevent("Forwarding X11 channel to client"); pktout = ssh2_chanopen_init(c, "x11"); put_stringz(pktout, (pi && pi->addr_text ? pi->addr_text : "0.0.0.0")); @@ -192,7 +192,7 @@ SshChannel *ssh2_serverside_agent_open(ConnectionLayer *cl, Channel *chan) c->halfopen = true; c->chan = chan; - ppl_logevent(("Forwarding SSH agent to client")); + ppl_logevent("Forwarding SSH agent to client"); pktout = ssh2_chanopen_init(c, "auth-agent@openssh.com"); pq_push(s->ppl.out_pq, pktout); diff --git a/ssh2connection.c b/ssh2connection.c index f9f40a9b..fff5bdcd 100644 --- a/ssh2connection.c +++ b/ssh2connection.c @@ -407,8 +407,8 @@ static bool ssh2_connection_filter_queue(struct ssh2_connection_state *s) put_stringz(pktout, chanopen_result.u.failure.wire_message); put_stringz(pktout, "en"); /* language tag */ pq_push(s->ppl.out_pq, pktout); - ppl_logevent(("Rejected channel open: %s", - chanopen_result.u.failure.wire_message)); + ppl_logevent("Rejected channel open: %s", + chanopen_result.u.failure.wire_message); sfree(chanopen_result.u.failure.wire_message); sfree(c); } else { @@ -685,8 +685,7 @@ static bool ssh2_connection_filter_queue(struct ssh2_connection_state *s) bs_modes, encoded_modes.ptr, encoded_modes.len); modes = read_ttymodes_from_packet(bs_modes, 2); if (get_err(bs_modes) || get_avail(bs_modes) > 0) { - ppl_logevent(("Unable to decode terminal mode " - "string")); + ppl_logevent("Unable to decode terminal mode string"); reply_success = false; } else { reply_success = chan_allocate_pty( @@ -1151,7 +1150,7 @@ static void ssh2_channel_close_local(struct ssh2_channel *c, msg = chan_log_close_msg(c->chan); if (msg) - ppl_logevent(("%s%s%s", msg, reason ? " " : "", reason ? reason : "")); + ppl_logevent("%s%s%s", msg, reason ? " " : "", reason ? reason : ""); sfree(msg); diff --git a/ssh2kex-client.c b/ssh2kex-client.c index 740c0829..d200b04c 100644 --- a/ssh2kex-client.c +++ b/ssh2kex-client.c @@ -43,7 +43,7 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) * requesting a group. */ if (dh_is_gex(s->kex_alg)) { - ppl_logevent(("Doing Diffie-Hellman group exchange")); + ppl_logevent("Doing Diffie-Hellman group exchange"); s->ppl.bpp->pls->kctx = SSH2_PKTCTX_DHGEX; /* * Work out how big a DH group we will need to allow that @@ -88,21 +88,21 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) s->kex_init_value = SSH2_MSG_KEX_DH_GEX_INIT; s->kex_reply_value = SSH2_MSG_KEX_DH_GEX_REPLY; - ppl_logevent(("Doing Diffie-Hellman key exchange using %d-bit " - "modulus and hash %s with a server-supplied group", - dh_modulus_bit_size(s->dh_ctx), - s->kex_alg->hash->text_name)); + ppl_logevent("Doing Diffie-Hellman key exchange using %d-bit " + "modulus and hash %s with a server-supplied group", + dh_modulus_bit_size(s->dh_ctx), + s->kex_alg->hash->text_name); } else { s->ppl.bpp->pls->kctx = SSH2_PKTCTX_DHGROUP; s->dh_ctx = dh_setup_group(s->kex_alg); s->kex_init_value = SSH2_MSG_KEXDH_INIT; s->kex_reply_value = SSH2_MSG_KEXDH_REPLY; - ppl_logevent(("Doing Diffie-Hellman key exchange using %d-bit " - "modulus and hash %s with standard group \"%s\"", - dh_modulus_bit_size(s->dh_ctx), - s->kex_alg->hash->text_name, - s->kex_alg->groupname)); + ppl_logevent("Doing Diffie-Hellman key exchange using %d-bit " + "modulus and hash %s with standard group \"%s\"", + dh_modulus_bit_size(s->dh_ctx), + s->kex_alg->hash->text_name, + s->kex_alg->groupname); } /* @@ -172,9 +172,9 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) } } else if (s->kex_alg->main_type == KEXTYPE_ECDH) { - ppl_logevent(("Doing ECDH key exchange with curve %s and hash %s", - ssh_ecdhkex_curve_textname(s->kex_alg), - s->kex_alg->hash->text_name)); + ppl_logevent("Doing ECDH key exchange with curve %s and hash %s", + ssh_ecdhkex_curve_textname(s->kex_alg), + s->kex_alg->hash->text_name); s->ppl.bpp->pls->kctx = SSH2_PKTCTX_ECDHKEX; s->ecdh_key = ssh_ecdhkex_newkey(s->kex_alg); @@ -268,8 +268,8 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) * much data. */ s->pbits = 512 << ((s->nbits - 1) / 64); - ppl_logevent(("Doing GSSAPI (with Kerberos V5) Diffie-Hellman " - "group exchange, with minimum %d bits", s->pbits)); + ppl_logevent("Doing GSSAPI (with Kerberos V5) Diffie-Hellman " + "group exchange, with minimum %d bits", s->pbits); pktout = ssh_bpp_new_pktout(s->ppl.bpp, SSH2_MSG_KEXGSS_GROUPREQ); put_uint32(pktout, s->pbits); /* min */ put_uint32(pktout, s->pbits); /* preferred */ @@ -297,18 +297,18 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) s->dh_ctx = dh_setup_gex(s->p, s->g); } else { s->dh_ctx = dh_setup_group(s->kex_alg); - ppl_logevent(("Using GSSAPI (with Kerberos V5) Diffie-Hellman with" - " standard group \"%s\"", s->kex_alg->groupname)); + ppl_logevent("Using GSSAPI (with Kerberos V5) Diffie-Hellman with" + " standard group \"%s\"", s->kex_alg->groupname); } - ppl_logevent(("Doing GSSAPI (with Kerberos V5) Diffie-Hellman key " - "exchange with hash %s", s->kex_alg->hash->text_name)); + ppl_logevent("Doing GSSAPI (with Kerberos V5) Diffie-Hellman key " + "exchange with hash %s", s->kex_alg->hash->text_name); /* Now generate e for Diffie-Hellman. */ seat_set_busy_status(s->ppl.seat, BUSY_CPU); s->e = dh_create_e(s->dh_ctx, s->nbits * 2); if (s->shgss->lib->gsslogmsg) - ppl_logevent(("%s", s->shgss->lib->gsslogmsg)); + ppl_logevent("%s", s->shgss->lib->gsslogmsg); /* initial tokens are empty */ SSH_GSS_CLEAR_BUF(&s->gss_rcvtok); @@ -369,7 +369,7 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) put_mp_ssh2(pktout, s->e); pq_push(s->ppl.out_pq, pktout); s->shgss->lib->free_tok(s->shgss->lib, &s->gss_sndtok); - ppl_logevent(("GSSAPI key exchange initialised")); + ppl_logevent("GSSAPI key exchange initialised"); } else if (s->gss_sndtok.length != 0) { pktout = ssh_bpp_new_pktout( s->ppl.bpp, SSH2_MSG_KEXGSS_CONTINUE); @@ -435,8 +435,8 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) get_uint32(pktin); /* server's major status */ get_uint32(pktin); /* server's minor status */ data = get_string(pktin); - ppl_logevent(("GSSAPI key exchange failed; " - "server's message: %.*s", PTRLEN_PRINTF(data))); + ppl_logevent("GSSAPI key exchange failed; " + "server's message: %.*s", PTRLEN_PRINTF(data)); /* Language tag, but we have no use for it */ get_string(pktin); /* @@ -496,8 +496,8 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) ptrlen rsakeydata; assert(s->kex_alg->main_type == KEXTYPE_RSA); - ppl_logevent(("Doing RSA key exchange with hash %s", - s->kex_alg->hash->text_name)); + ppl_logevent("Doing RSA key exchange with hash %s", + s->kex_alg->hash->text_name); s->ppl.bpp->pls->kctx = SSH2_PKTCTX_RSAKEX; /* * RSA key exchange. First expect a KEXRSA_PUBKEY packet @@ -643,7 +643,7 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) if (s->got_session_id) { s->shgss->lib->release_cred(s->shgss->lib, &s->shgss->ctx); } - ppl_logevent(("GSSAPI Key Exchange complete!")); + ppl_logevent("GSSAPI Key Exchange complete!"); } #endif @@ -682,8 +682,8 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) */ if (s->hkey) { s->fingerprint = ssh2_fingerprint(s->hkey); - ppl_logevent(("GSS kex provided fallback host key:")); - ppl_logevent(("%s", s->fingerprint)); + ppl_logevent("GSS kex provided fallback host key:"); + ppl_logevent("%s", s->fingerprint); sfree(s->fingerprint); s->fingerprint = NULL; ssh_transient_hostkey_cache_add(s->thc, s->hkey); @@ -724,7 +724,7 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) * consequence. */ if (!s->warned_about_no_gss_transient_hostkey) { - ppl_logevent(("No fallback host key available")); + ppl_logevent("No fallback host key available"); s->warned_about_no_gss_transient_hostkey = true; } } @@ -742,14 +742,14 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) s->fingerprint = ssh2_fingerprint(s->hkey); if (s->need_gss_transient_hostkey) { - ppl_logevent(("Post-GSS rekey provided fallback host key:")); - ppl_logevent(("%s", s->fingerprint)); + ppl_logevent("Post-GSS rekey provided fallback host key:"); + ppl_logevent("%s", s->fingerprint); ssh_transient_hostkey_cache_add(s->thc, s->hkey); s->need_gss_transient_hostkey = false; } else if (!ssh_transient_hostkey_cache_verify(s->thc, s->hkey)) { - ppl_logevent(("Non-GSS rekey after initial GSS kex " - "used host key:")); - ppl_logevent(("%s", s->fingerprint)); + ppl_logevent("Non-GSS rekey after initial GSS kex " + "used host key:"); + ppl_logevent("%s", s->fingerprint); ssh_sw_abort(s->ppl.ssh, "Server's host key did not match any " "used in previous GSS kex"); return; @@ -790,10 +790,10 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) } } if (list) { - ppl_logevent(("Server also has %s host key%s, but we " - "don't know %s", list, - nkeys > 1 ? "s" : "", - nkeys > 1 ? "any of them" : "it")); + ppl_logevent("Server also has %s host key%s, but we " + "don't know %s", list, + nkeys > 1 ? "s" : "", + nkeys > 1 ? "any of them" : "it"); sfree(list); } } @@ -803,8 +803,8 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) * checked the signature of the exchange hash.) */ s->fingerprint = ssh2_fingerprint(s->hkey); - ppl_logevent(("Host key fingerprint is:")); - ppl_logevent(("%s", s->fingerprint)); + ppl_logevent("Host key fingerprint is:"); + ppl_logevent("%s", s->fingerprint); /* First check against manually configured host keys. */ s->dlgret = verify_ssh_manual_host_key( s->conf, s->fingerprint, s->hkey); @@ -840,8 +840,8 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) assert(ssh_key_alg(s->hkey) == s->cross_certifying); s->fingerprint = ssh2_fingerprint(s->hkey); - ppl_logevent(("Storing additional host key for this host:")); - ppl_logevent(("%s", s->fingerprint)); + ppl_logevent("Storing additional host key for this host:"); + ppl_logevent("%s", s->fingerprint); sfree(s->fingerprint); s->fingerprint = NULL; store_host_key(s->savedhost, s->savedport, diff --git a/ssh2kex-server.c b/ssh2kex-server.c index 570b4766..92a449f0 100644 --- a/ssh2kex-server.c +++ b/ssh2kex-server.c @@ -66,7 +66,7 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) * waiting for the group request. */ if (dh_is_gex(s->kex_alg)) { - ppl_logevent(("Doing Diffie-Hellman group exchange")); + ppl_logevent("Doing Diffie-Hellman group exchange"); s->ppl.bpp->pls->kctx = SSH2_PKTCTX_DHGEX; crMaybeWaitUntilV((pktin = ssh2_transport_pop(s)) != NULL); @@ -111,12 +111,12 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) s->dh_ctx = dh_setup_group(s->kex_alg); s->kex_init_value = SSH2_MSG_KEXDH_INIT; s->kex_reply_value = SSH2_MSG_KEXDH_REPLY; - ppl_logevent(("Using Diffie-Hellman with standard group \"%s\"", - s->kex_alg->groupname)); + ppl_logevent("Using Diffie-Hellman with standard group \"%s\"", + s->kex_alg->groupname); } - ppl_logevent(("Doing Diffie-Hellman key exchange with hash %s", - s->kex_alg->hash->text_name)); + ppl_logevent("Doing Diffie-Hellman key exchange with hash %s", + s->kex_alg->hash->text_name); /* * Generate e for Diffie-Hellman. @@ -179,9 +179,9 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) freebn(s->p); s->p = NULL; } } else if (s->kex_alg->main_type == KEXTYPE_ECDH) { - ppl_logevent(("Doing ECDH key exchange with curve %s and hash %s", - ssh_ecdhkex_curve_textname(s->kex_alg), - s->kex_alg->hash->text_name)); + ppl_logevent("Doing ECDH key exchange with curve %s and hash %s", + ssh_ecdhkex_curve_textname(s->kex_alg), + s->kex_alg->hash->text_name); s->ppl.bpp->pls->kctx = SSH2_PKTCTX_ECDHKEX; s->ecdh_key = ssh_ecdhkex_newkey(s->kex_alg); @@ -230,8 +230,8 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s) ssh_sw_abort(s->ppl.ssh, "GSS key exchange not supported in server"); } else { assert(s->kex_alg->main_type == KEXTYPE_RSA); - ppl_logevent(("Doing RSA key exchange with hash %s", - s->kex_alg->hash->text_name)); + ppl_logevent("Doing RSA key exchange with hash %s", + s->kex_alg->hash->text_name); s->ppl.bpp->pls->kctx = SSH2_PKTCTX_RSAKEX; { diff --git a/ssh2transport.c b/ssh2transport.c index bf9a24dc..4ebfb2f5 100644 --- a/ssh2transport.c +++ b/ssh2transport.c @@ -344,7 +344,7 @@ bool ssh2_common_filter_queue(PacketProtocolLayer *ppl) /* XXX maybe we should actually take notice of the return value */ get_bool(pktin); msg = get_string(pktin); - ppl_logevent(("Remote debug message: %.*s", PTRLEN_PRINTF(msg))); + ppl_logevent("Remote debug message: %.*s", PTRLEN_PRINTF(msg)); pq_pop(ppl->in_pq); break; @@ -961,7 +961,7 @@ void ssh2transport_finalise_exhash(struct ssh2_transport_state *s) s->exhash = NULL; #if 0 - debug(("Exchange hash is:\n")); + debug("Exchange hash is:\n"); dmemdump(s->exchange_hash, s->kex_alg->hash->hlen); #endif } @@ -1375,7 +1375,7 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) * deferred rekey reason. */ if (s->deferred_rekey_reason) { - ppl_logevent(("%s", s->deferred_rekey_reason)); + ppl_logevent("%s", s->deferred_rekey_reason); pktin = NULL; s->deferred_rekey_reason = NULL; goto begin_key_exchange; @@ -1462,7 +1462,7 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) return; } pq_push_front(s->ppl.in_pq, pktin); - ppl_logevent(("Remote side initiated key re-exchange")); + ppl_logevent("Remote side initiated key re-exchange"); s->rekey_class = RK_SERVER; } @@ -1507,8 +1507,8 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) * rekey, we process it anyway!) */ if ((s->ppl.remote_bugs & BUG_SSH2_REKEY)) { - ppl_logevent(("Remote bug prevents key re-exchange (%s)", - s->rekey_reason)); + ppl_logevent("Remote bug prevents key re-exchange (%s)", + s->rekey_reason); /* Reset the counters, so that at least this message doesn't * hit the event log _too_ often. */ s->stats->in.running = s->stats->out.running = true; @@ -1517,8 +1517,8 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) (void) ssh2_transport_timer_update(s, 0); s->rekey_class = RK_NONE; } else { - ppl_logevent(("Initiating key re-exchange (%s)", - s->rekey_reason)); + ppl_logevent("Initiating key re-exchange (%s)", + s->rekey_reason); } } } while (s->rekey_class == RK_NONE); @@ -1694,11 +1694,11 @@ static void ssh2_transport_gss_update(struct ssh2_transport_state *s, s->shgss->lib, s->fullhostname, &s->shgss->srv_name); if (gss_stat != SSH_GSS_OK) { if (gss_stat == SSH_GSS_BAD_HOST_NAME) - ppl_logevent(("GSSAPI import name failed - Bad service name;" - " won't use GSS key exchange")); + ppl_logevent("GSSAPI import name failed - Bad service name;" + " won't use GSS key exchange"); else - ppl_logevent(("GSSAPI import name failed;" - " won't use GSS key exchange")); + ppl_logevent("GSSAPI import name failed;" + " won't use GSS key exchange"); return; } } @@ -1740,7 +1740,7 @@ static void ssh2_transport_gss_update(struct ssh2_transport_state *s, * it shouldn't pop up all the time regardless. */ if (definitely_rekeying) - ppl_logevent(("No GSSAPI security context available")); + ppl_logevent("No GSSAPI security context available"); return; } diff --git a/ssh2userauth.c b/ssh2userauth.c index 23015807..2a3ae9b1 100644 --- a/ssh2userauth.c +++ b/ssh2userauth.c @@ -225,8 +225,8 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) */ if (!filename_is_null(s->keyfile)) { int keytype; - ppl_logevent(("Reading key file \"%.150s\"", - filename_to_str(s->keyfile))); + ppl_logevent("Reading key file \"%.150s\"", + filename_to_str(s->keyfile)); keytype = key_type(s->keyfile); if (keytype == SSH_KEYTYPE_SSH2 || keytype == SSH_KEYTYPE_SSH2_PUBLIC_RFC4716 || @@ -239,22 +239,22 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) &s->publickey_comment, &error)) { s->privatekey_available = (keytype == SSH_KEYTYPE_SSH2); if (!s->privatekey_available) - ppl_logevent(("Key file contains public key only")); + ppl_logevent("Key file contains public key only"); s->privatekey_encrypted = ssh2_userkey_encrypted(s->keyfile, NULL); } else { - ppl_logevent(("Unable to load key (%s)", error)); - ppl_printf(("Unable to load key file \"%s\" (%s)\r\n", - filename_to_str(s->keyfile), error)); + ppl_logevent("Unable to load key (%s)", error); + ppl_printf("Unable to load key file \"%s\" (%s)\r\n", + filename_to_str(s->keyfile), error); strbuf_free(s->publickey_blob); s->publickey_blob = NULL; } } else { - ppl_logevent(("Unable to use this key file (%s)", - key_type_to_str(keytype))); - ppl_printf(("Unable to use key file \"%s\" (%s)\r\n", - filename_to_str(s->keyfile), - key_type_to_str(keytype))); + ppl_logevent("Unable to use this key file (%s)", + key_type_to_str(keytype)); + ppl_printf("Unable to use key file \"%s\" (%s)\r\n", + filename_to_str(s->keyfile), + key_type_to_str(keytype)); s->publickey_blob = NULL; } } @@ -266,7 +266,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->nkeys = 0; s->pkblob_pos_in_agent = 0; if (s->tryagent && agent_exists()) { - ppl_logevent(("Pageant is running. Requesting keys.")); + ppl_logevent("Pageant is running. Requesting keys."); /* Request the keys held by the agent. */ { @@ -290,12 +290,12 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) * and blob lengths make sense. */ if (s->nkeys < 0) { - ppl_logevent(("Pageant response contained a negative" - " key count %d", s->nkeys)); + ppl_logevent("Pageant response contained a negative" + " key count %d", s->nkeys); s->nkeys = 0; goto done_agent_query; } else { - ppl_logevent(("Pageant has %d SSH-2 keys", s->nkeys)); + ppl_logevent("Pageant has %d SSH-2 keys", s->nkeys); /* See if configured key is in agent. */ for (keyi = 0; keyi < s->nkeys; keyi++) { @@ -303,7 +303,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) ptrlen blob = get_string(s->asrc); get_string(s->asrc); /* skip comment */ if (get_err(s->asrc)) { - ppl_logevent(("Pageant response was truncated")); + ppl_logevent("Pageant response was truncated"); s->nkeys = 0; goto done_agent_query; } @@ -312,20 +312,20 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) blob.len == s->publickey_blob->len && !memcmp(blob.ptr, s->publickey_blob->s, s->publickey_blob->len)) { - ppl_logevent(("Pageant key #%d matches " - "configured key file", keyi)); + ppl_logevent("Pageant key #%d matches " + "configured key file", keyi); s->keyi = keyi; s->pkblob_pos_in_agent = pos; break; } } if (s->publickey_blob && !s->pkblob_pos_in_agent) { - ppl_logevent(("Configured key file not in Pageant")); + ppl_logevent("Configured key file not in Pageant"); s->nkeys = 0; } } } else { - ppl_logevent(("Failed to get reply from Pageant")); + ppl_logevent("Failed to get reply from Pageant"); } done_agent_query:; } @@ -398,7 +398,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) free_prompts(s->cur_prompt); } else { if ((flags & FLAG_VERBOSE) || (flags & FLAG_INTERACTIVE)) - ppl_printf(("Using username \"%s\".\r\n", s->username)); + ppl_printf("Using username \"%s\".\r\n", s->username); } s->got_username = true; @@ -475,7 +475,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) bufchain_clear(&s->banner); } if (pktin && pktin->type == SSH2_MSG_USERAUTH_SUCCESS) { - ppl_logevent(("Access granted")); + ppl_logevent("Access granted"); goto userauth_success; } @@ -528,32 +528,32 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) } else if (s->type == AUTH_TYPE_PUBLICKEY_OFFER_LOUD || s->type == AUTH_TYPE_PUBLICKEY_OFFER_QUIET) { if (s->type == AUTH_TYPE_PUBLICKEY_OFFER_LOUD) - ppl_printf(("Server refused our key\r\n")); - ppl_logevent(("Server refused our key")); + ppl_printf("Server refused our key\r\n"); + ppl_logevent("Server refused our key"); } else if (s->type == AUTH_TYPE_PUBLICKEY) { /* This _shouldn't_ happen except by a * protocol bug causing client and server to * disagree on what is a correct signature. */ - ppl_printf(("Server refused public-key signature" - " despite accepting key!\r\n")); - ppl_logevent(("Server refused public-key signature" - " despite accepting key!")); + ppl_printf("Server refused public-key signature" + " despite accepting key!\r\n"); + ppl_logevent("Server refused public-key signature" + " despite accepting key!"); } else if (s->type==AUTH_TYPE_KEYBOARD_INTERACTIVE_QUIET) { /* quiet, so no ppl_printf */ - ppl_logevent(("Server refused keyboard-interactive " - "authentication")); + ppl_logevent("Server refused keyboard-interactive " + "authentication"); } else if (s->type==AUTH_TYPE_GSSAPI) { /* always quiet, so no ppl_printf */ /* also, the code down in the GSSAPI block has * already logged this in the Event Log */ } else if (s->type == AUTH_TYPE_KEYBOARD_INTERACTIVE) { - ppl_logevent(("Keyboard-interactive authentication " - "failed")); - ppl_printf(("Access denied\r\n")); + ppl_logevent("Keyboard-interactive authentication " + "failed"); + ppl_printf("Access denied\r\n"); } else { assert(s->type == AUTH_TYPE_PASSWORD); - ppl_logevent(("Password authentication failed")); - ppl_printf(("Access denied\r\n")); + ppl_logevent("Password authentication failed"); + ppl_printf("Access denied\r\n"); if (s->change_username) { /* XXX perhaps we should allow @@ -562,8 +562,8 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) } } } else { - ppl_printf(("Further authentication required\r\n")); - ppl_logevent(("Further authentication required")); + ppl_printf("Further authentication required\r\n"); + ppl_logevent("Further authentication required"); } /* @@ -620,9 +620,9 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->ppl.bpp->pls->actx = SSH2_PKTCTX_GSSAPI; if (s->shgss->lib->gsslogmsg) - ppl_logevent(("%s", s->shgss->lib->gsslogmsg)); + ppl_logevent("%s", s->shgss->lib->gsslogmsg); - ppl_logevent(("Trying gssapi-keyex...")); + ppl_logevent("Trying gssapi-keyex..."); s->pktout = ssh2_userauth_gss_packet(s, "gssapi-keyex"); pq_push(s->ppl.out_pq, s->pktout); s->shgss->lib->release_cred(s->shgss->lib, &s->shgss->ctx); @@ -640,7 +640,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->ppl.bpp->pls->actx = SSH2_PKTCTX_PUBLICKEY; - ppl_logevent(("Trying Pageant key #%d", s->keyi)); + ppl_logevent("Trying Pageant key #%d", s->keyi); /* Unpack key from agent response */ s->pk = get_string(s->asrc); @@ -675,9 +675,9 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) strbuf *agentreq, *sigdata; if (flags & FLAG_VERBOSE) - ppl_printf(("Authenticating with public key " - "\"%.*s\" from agent\r\n", - PTRLEN_PRINTF(s->comment))); + ppl_printf("Authenticating with public key " + "\"%.*s\" from agent\r\n", + PTRLEN_PRINTF(s->comment)); /* * Server is willing to accept the key. @@ -717,7 +717,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) get_uint32(src); /* skip length field */ if (get_byte(src) == SSH2_AGENT_SIGN_RESPONSE && (sigblob = get_string(src), !get_err(src))) { - ppl_logevent(("Sending Pageant's response")); + ppl_logevent("Sending Pageant's response"); ssh2_userauth_add_sigblob(s, s->pktout, s->pk, sigblob); pq_push(s->ppl.out_pq, s->pktout); @@ -768,7 +768,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) put_string(s->pktout, s->publickey_blob->s, s->publickey_blob->len); pq_push(s->ppl.out_pq, s->pktout); - ppl_logevent(("Offered public key")); + ppl_logevent("Offered public key"); crMaybeWaitUntilV((pktin = ssh2_userauth_pop(s)) != NULL); if (pktin->type != SSH2_MSG_USERAUTH_PK_OK) { @@ -777,15 +777,15 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->type = AUTH_TYPE_PUBLICKEY_OFFER_LOUD; continue; /* process this new message */ } - ppl_logevent(("Offer of public key accepted")); + ppl_logevent("Offer of public key accepted"); /* * Actually attempt a serious authentication using * the key. */ if (flags & FLAG_VERBOSE) - ppl_printf(("Authenticating with public key \"%s\"\r\n", - s->publickey_comment)); + ppl_printf("Authenticating with public key \"%s\"\r\n", + s->publickey_comment); key = NULL; while (!key) { @@ -846,12 +846,12 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) if (key == SSH2_WRONG_PASSPHRASE || key == NULL) { if (passphrase && (key == SSH2_WRONG_PASSPHRASE)) { - ppl_printf(("Wrong passphrase\r\n")); + ppl_printf("Wrong passphrase\r\n"); key = NULL; /* and loop again */ } else { - ppl_printf(("Unable to load private key (%s)\r\n", - error)); + ppl_printf("Unable to load private key (%s)\r\n", + error); key = NULL; break; /* try something else */ } @@ -900,7 +900,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) strbuf_free(sigblob); pq_push(s->ppl.out_pq, s->pktout); - ppl_logevent(("Sent public key signature")); + ppl_logevent("Sent public key signature"); s->type = AUTH_TYPE_PUBLICKEY; ssh_key_free(key->key); sfree(key->comment); @@ -919,16 +919,16 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->ppl.bpp->pls->actx = SSH2_PKTCTX_GSSAPI; if (s->shgss->lib->gsslogmsg) - ppl_logevent(("%s", s->shgss->lib->gsslogmsg)); + ppl_logevent("%s", s->shgss->lib->gsslogmsg); /* Sending USERAUTH_REQUEST with "gssapi-with-mic" method */ - ppl_logevent(("Trying gssapi-with-mic...")); + ppl_logevent("Trying gssapi-with-mic..."); s->pktout = ssh_bpp_new_pktout( s->ppl.bpp, SSH2_MSG_USERAUTH_REQUEST); put_stringz(s->pktout, s->username); put_stringz(s->pktout, s->successor_layer->vt->name); put_stringz(s->pktout, "gssapi-with-mic"); - ppl_logevent(("Attempting GSSAPI authentication")); + ppl_logevent("Attempting GSSAPI authentication"); /* add mechanism info */ s->shgss->lib->indicate_mech(s->shgss->lib, &s->gss_buf); @@ -947,7 +947,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) pq_push(s->ppl.out_pq, s->pktout); crMaybeWaitUntilV((pktin = ssh2_userauth_pop(s)) != NULL); if (pktin->type != SSH2_MSG_USERAUTH_GSSAPI_RESPONSE) { - ppl_logevent(("GSSAPI authentication request refused")); + ppl_logevent("GSSAPI authentication request refused"); pq_push_front(s->ppl.in_pq, pktin); continue; } @@ -962,8 +962,8 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) ((char *)s->gss_rcvtok.value)[1] != s->gss_buf.length || memcmp((char *)s->gss_rcvtok.value + 2, s->gss_buf.value,s->gss_buf.length) ) { - ppl_logevent(("GSSAPI authentication - wrong response " - "from server")); + ppl_logevent("GSSAPI authentication - wrong response " + "from server"); continue; } @@ -973,10 +973,10 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->shgss->lib, s->fullhostname, &s->shgss->srv_name); if (s->gss_stat != SSH_GSS_OK) { if (s->gss_stat == SSH_GSS_BAD_HOST_NAME) - ppl_logevent(("GSSAPI import name failed -" - " Bad service name")); + ppl_logevent("GSSAPI import name failed -" + " Bad service name"); else - ppl_logevent(("GSSAPI import name failed")); + ppl_logevent("GSSAPI import name failed"); continue; } } @@ -985,8 +985,8 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->gss_stat = s->shgss->lib->acquire_cred( s->shgss->lib, &s->shgss->ctx, NULL); if (s->gss_stat != SSH_GSS_OK) { - ppl_logevent(("GSSAPI authentication failed to get " - "credentials")); + ppl_logevent("GSSAPI authentication failed to get " + "credentials"); /* The failure was on our side, so the server * won't be sending a response packet indicating * failure. Avoid waiting for it next time round @@ -1017,19 +1017,19 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) if (s->gss_stat!=SSH_GSS_S_COMPLETE && s->gss_stat!=SSH_GSS_S_CONTINUE_NEEDED) { - ppl_logevent(("GSSAPI authentication initialisation " - "failed")); + ppl_logevent("GSSAPI authentication initialisation " + "failed"); if (s->shgss->lib->display_status(s->shgss->lib, s->shgss->ctx, &s->gss_buf) == SSH_GSS_OK) { - ppl_logevent(("%s", (char *)s->gss_buf.value)); + ppl_logevent("%s", (char *)s->gss_buf.value); sfree(s->gss_buf.value); } pq_push_front(s->ppl.in_pq, pktin); break; } - ppl_logevent(("GSSAPI authentication initialised")); + ppl_logevent("GSSAPI authentication initialised"); /* * Client and server now exchange tokens until GSSAPI @@ -1076,14 +1076,14 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) } if (pktin->type == SSH2_MSG_USERAUTH_FAILURE) { - ppl_logevent(("GSSAPI authentication failed")); + ppl_logevent("GSSAPI authentication failed"); s->gss_stat = SSH_GSS_FAILURE; pq_push_front(s->ppl.in_pq, pktin); break; } else if (pktin->type != SSH2_MSG_USERAUTH_GSSAPI_TOKEN) { - ppl_logevent(("GSSAPI authentication -" - " bad server response")); + ppl_logevent("GSSAPI authentication -" + " bad server response"); s->gss_stat = SSH_GSS_FAILURE; break; } @@ -1097,7 +1097,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->shgss->lib->release_cred(s->shgss->lib, &s->shgss->ctx); continue; } - ppl_logevent(("GSSAPI authentication loop finished OK")); + ppl_logevent("GSSAPI authentication loop finished OK"); /* Now send the MIC */ @@ -1127,7 +1127,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) put_stringz(s->pktout, ""); /* submethods */ pq_push(s->ppl.out_pq, s->pktout); - ppl_logevent(("Attempting keyboard-interactive authentication")); + ppl_logevent("Attempting keyboard-interactive authentication"); crMaybeWaitUntilV((pktin = ssh2_userauth_pop(s)) != NULL); if (pktin->type != SSH2_MSG_USERAUTH_INFO_REQUEST) { @@ -1342,7 +1342,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) put_stringz(s->pktout, s->password); s->pktout->minlen = 256; pq_push(s->ppl.out_pq, s->pktout); - ppl_logevent(("Sent password")); + ppl_logevent("Sent password"); s->type = AUTH_TYPE_PASSWORD; /* @@ -1369,8 +1369,8 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) msg = "Server requested password change"; else msg = "Server rejected new password"; - ppl_logevent(("%s", msg)); - ppl_printf(("%s\r\n", msg)); + ppl_logevent("%s", msg); + ppl_printf("%s\r\n", msg); } prompt = get_string(pktin); @@ -1460,7 +1460,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) == 0); if (!got_new) /* They don't. Silly user. */ - ppl_printf(("Passwords do not match\r\n")); + ppl_printf("Passwords do not match\r\n"); } @@ -1480,7 +1480,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) free_prompts(s->cur_prompt); s->pktout->minlen = 256; pq_push(s->ppl.out_pq, s->pktout); - ppl_logevent(("Sent new password")); + ppl_logevent("Sent new password"); /* * Now see what the server has to say about it. @@ -1635,8 +1635,8 @@ static void ssh2_userauth_add_sigblob( mod_mp.ptr = (const char *)mod_mp.ptr + 1; } - /* debug(("modulus length is %d\n", len)); */ - /* debug(("signature length is %d\n", siglen)); */ + /* debug("modulus length is %d\n", len); */ + /* debug("signature length is %d\n", siglen); */ if (mod_mp.len != sig_mp.len) { strbuf *substr = strbuf_new(); diff --git a/sshbn.c b/sshbn.c index d61e3ab6..c3cb5544 100644 --- a/sshbn.c +++ b/sshbn.c @@ -1938,20 +1938,19 @@ void diagbn(char *prefix, Bignum md) int i, nibbles, morenibbles; static const char hex[] = "0123456789ABCDEF"; - debug(("%s0x", prefix ? prefix : "")); + debug("%s0x", prefix ? prefix : ""); nibbles = (3 + bignum_bitcount(md)) / 4; if (nibbles < 1) nibbles = 1; morenibbles = 4 * md[0] - nibbles; for (i = 0; i < morenibbles; i++) - debug(("-")); + debug("-"); for (i = nibbles; i--;) - debug(("%c", - hex[(bignum_byte(md, i / 2) >> (4 * (i % 2))) & 0xF])); + debug("%c", hex[(bignum_byte(md, i / 2) >> (4 * (i % 2))) & 0xF]); if (prefix) - debug(("\n")); + debug("\n"); } #endif diff --git a/sshbpp.h b/sshbpp.h index 26ff477d..8a8e8e95 100644 --- a/sshbpp.h +++ b/sshbpp.h @@ -71,11 +71,9 @@ void ssh2_bpp_queue_disconnect(BinaryPacketProtocol *bpp, bool ssh2_bpp_check_unimplemented(BinaryPacketProtocol *bpp, PktIn *pktin); /* Convenience macro for BPPs to send formatted strings to the Event - * Log. Assumes a function parameter called 'bpp' is in scope, and - * takes a double pair of parens because it passes a whole argument - * list to dupprintf. */ -#define bpp_logevent(params) ( \ - logevent_and_free((bpp)->logctx, dupprintf params)) + * Log. Assumes a function parameter called 'bpp' is in scope. */ +#define bpp_logevent(...) ( \ + logevent_and_free((bpp)->logctx, dupprintf(__VA_ARGS__))) /* * Structure that tracks how much data is sent and received, for diff --git a/sshcommon.c b/sshcommon.c index 1117881b..337c3293 100644 --- a/sshcommon.c +++ b/sshcommon.c @@ -986,7 +986,7 @@ bool ssh1_common_filter_queue(PacketProtocolLayer *ppl) case SSH1_MSG_DEBUG: msg = get_string(pktin); - ppl_logevent(("Remote debug message: %.*s", PTRLEN_PRINTF(msg))); + ppl_logevent("Remote debug message: %.*s", PTRLEN_PRINTF(msg)); pq_pop(ppl->in_pq); break; diff --git a/sshppl.h b/sshppl.h index 80be9d14..f3ee4027 100644 --- a/sshppl.h +++ b/sshppl.h @@ -118,16 +118,14 @@ void ssh2_userauth_set_transport_layer(PacketProtocolLayer *userauth, /* Convenience macro for protocol layers to send formatted strings to * the Event Log. Assumes a function parameter called 'ppl' is in - * scope, and takes a double pair of parens because it passes a whole - * argument list to dupprintf. */ -#define ppl_logevent(params) ( \ - logevent_and_free((ppl)->logctx, dupprintf params)) + * scope. */ +#define ppl_logevent(...) ( \ + logevent_and_free((ppl)->logctx, dupprintf(__VA_ARGS__))) /* Convenience macro for protocol layers to send formatted strings to - * the terminal. Also expects 'ppl' to be in scope and takes double - * parens. */ -#define ppl_printf(params) \ - ssh_ppl_user_output_string_and_free(ppl, dupprintf params) + * the terminal. Also expects 'ppl' to be in scope. */ +#define ppl_printf(...) \ + ssh_ppl_user_output_string_and_free(ppl, dupprintf(__VA_ARGS__)) void ssh_ppl_user_output_string_and_free(PacketProtocolLayer *ppl, char *text); /* Methods for userauth to communicate back to the transport layer */ diff --git a/sshverstring.c b/sshverstring.c index 438be8ef..cf40cbaa 100644 --- a/sshverstring.c +++ b/sshverstring.c @@ -201,7 +201,7 @@ static void ssh_verstring_send(struct ssh_verstring_state *s) bufchain_add(s->bpp.out_raw, "\015", 1); bufchain_add(s->bpp.out_raw, "\012", 1); - bpp_logevent(("We claim version: %s", s->our_vstring)); + bpp_logevent("We claim version: %s", s->our_vstring); } #define BPP_WAITFOR(minlen) do \ @@ -312,7 +312,7 @@ void ssh_verstring_handle_input(BinaryPacketProtocol *bpp) s->vslen--; s->vstring[s->vslen] = '\0'; - bpp_logevent(("Remote version: %s", s->vstring)); + bpp_logevent("Remote version: %s", s->vstring); /* * Pick out the protocol version and software version. The former @@ -378,7 +378,7 @@ void ssh_verstring_handle_input(BinaryPacketProtocol *bpp) crStopV; } - bpp_logevent(("Using SSH protocol version %d", s->major_protoversion)); + bpp_logevent("Using SSH protocol version %d", s->major_protoversion); if (!s->send_early) { /* @@ -450,7 +450,7 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * sniffing. */ s->remote_bugs |= BUG_CHOKES_ON_SSH1_IGNORE; - bpp_logevent(("We believe remote version has SSH-1 ignore bug")); + bpp_logevent("We believe remote version has SSH-1 ignore bug"); } if (conf_get_int(s->conf, CONF_sshbug_plainpw1) == FORCE_ON || @@ -462,8 +462,8 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * the password. */ s->remote_bugs |= BUG_NEEDS_SSH1_PLAIN_PASSWORD; - bpp_logevent(("We believe remote version needs a " - "plain SSH-1 password")); + bpp_logevent("We believe remote version needs a " + "plain SSH-1 password"); } if (conf_get_int(s->conf, CONF_sshbug_rsa1) == FORCE_ON || @@ -475,8 +475,8 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * an AUTH_RSA message. */ s->remote_bugs |= BUG_CHOKES_ON_RSA; - bpp_logevent(("We believe remote version can't handle SSH-1 " - "RSA authentication")); + bpp_logevent("We believe remote version can't handle SSH-1 " + "RSA authentication"); } if (conf_get_int(s->conf, CONF_sshbug_hmac2) == FORCE_ON || @@ -489,7 +489,7 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * These versions have the HMAC bug. */ s->remote_bugs |= BUG_SSH2_HMAC; - bpp_logevent(("We believe remote version has SSH-2 HMAC bug")); + bpp_logevent("We believe remote version has SSH-2 HMAC bug"); } if (conf_get_int(s->conf, CONF_sshbug_derivekey2) == FORCE_ON || @@ -502,8 +502,8 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * generate the keys). */ s->remote_bugs |= BUG_SSH2_DERIVEKEY; - bpp_logevent(("We believe remote version has SSH-2 " - "key-derivation bug")); + bpp_logevent("We believe remote version has SSH-2 " + "key-derivation bug"); } if (conf_get_int(s->conf, CONF_sshbug_rsapad2) == FORCE_ON || @@ -516,7 +516,7 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * These versions have the SSH-2 RSA padding bug. */ s->remote_bugs |= BUG_SSH2_RSA_PADDING; - bpp_logevent(("We believe remote version has SSH-2 RSA padding bug")); + bpp_logevent("We believe remote version has SSH-2 RSA padding bug"); } if (conf_get_int(s->conf, CONF_sshbug_pksessid2) == FORCE_ON || @@ -527,8 +527,8 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * public-key authentication. */ s->remote_bugs |= BUG_SSH2_PK_SESSIONID; - bpp_logevent(("We believe remote version has SSH-2 " - "public-key-session-ID bug")); + bpp_logevent("We believe remote version has SSH-2 " + "public-key-session-ID bug"); } if (conf_get_int(s->conf, CONF_sshbug_rekey2) == FORCE_ON || @@ -544,7 +544,7 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * These versions have the SSH-2 rekey bug. */ s->remote_bugs |= BUG_SSH2_REKEY; - bpp_logevent(("We believe remote version has SSH-2 rekey bug")); + bpp_logevent("We believe remote version has SSH-2 rekey bug"); } if (conf_get_int(s->conf, CONF_sshbug_maxpkt2) == FORCE_ON || @@ -555,8 +555,8 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * This version ignores our makpkt and needs to be throttled. */ s->remote_bugs |= BUG_SSH2_MAXPKT; - bpp_logevent(("We believe remote version ignores SSH-2 " - "maximum packet size")); + bpp_logevent("We believe remote version ignores SSH-2 " + "maximum packet size"); } if (conf_get_int(s->conf, CONF_sshbug_ignore2) == FORCE_ON) { @@ -565,7 +565,7 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * none detected automatically. */ s->remote_bugs |= BUG_CHOKES_ON_SSH2_IGNORE; - bpp_logevent(("We believe remote version has SSH-2 ignore bug")); + bpp_logevent("We believe remote version has SSH-2 ignore bug"); } if (conf_get_int(s->conf, CONF_sshbug_oldgex2) == FORCE_ON || @@ -577,7 +577,7 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * we use the newer version. */ s->remote_bugs |= BUG_SSH2_OLDGEX; - bpp_logevent(("We believe remote version has outdated SSH-2 GEX")); + bpp_logevent("We believe remote version has outdated SSH-2 GEX"); } if (conf_get_int(s->conf, CONF_sshbug_winadj) == FORCE_ON) { @@ -586,7 +586,7 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * reason or another. Currently, none detected automatically. */ s->remote_bugs |= BUG_CHOKES_ON_WINADJ; - bpp_logevent(("We believe remote version has winadj bug")); + bpp_logevent("We believe remote version has winadj bug"); } if (conf_get_int(s->conf, CONF_sshbug_chanreq) == FORCE_ON || @@ -603,8 +603,8 @@ static void ssh_detect_bugs(struct ssh_verstring_state *s) * https://secure.ucc.asn.au/hg/dropbear/rev/cd02449b709c */ s->remote_bugs |= BUG_SENDS_LATE_REQUEST_REPLY; - bpp_logevent(("We believe remote version has SSH-2 " - "channel request bug")); + bpp_logevent("We believe remote version has SSH-2 " + "channel request bug"); } } diff --git a/unix/gtkwin.c b/unix/gtkwin.c index c450c252..9ba3f7fd 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -1065,12 +1065,12 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) } } - debug(("key_event: type=%s keyval=%s state=%s " - "hardware_keycode=%d is_modifier=%s string=[%s]\n", - type_string, keyval_string, state_string, - (int)event->hardware_keycode, - event->is_modifier ? "true" : "false", - string_string)); + debug("key_event: type=%s keyval=%s state=%s " + "hardware_keycode=%d is_modifier=%s string=[%s]\n", + type_string, keyval_string, state_string, + (int)event->hardware_keycode, + event->is_modifier ? "true" : "false", + string_string); sfree(type_string); sfree(state_string); @@ -1096,8 +1096,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) event->keyval == GDK_KEY_Alt_R) && inst->alt_keycode >= 0 && inst->alt_digits > 1) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - modifier release terminates Alt+numberpad input, " - "keycode = %d\n", inst->alt_keycode)); + debug(" - modifier release terminates Alt+numberpad input, " + "keycode = %d\n", inst->alt_keycode); #endif /* * FIXME: we might usefully try to do something clever here @@ -1110,16 +1110,16 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) } #if GTK_CHECK_VERSION(2,0,0) #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - key release, passing to IM\n")); + debug(" - key release, passing to IM\n"); #endif if (gtk_im_context_filter_keypress(inst->imc, event)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - key release accepted by IM\n")); + debug(" - key release accepted by IM\n"); #endif return true; } else { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - key release not accepted by IM\n")); + debug(" - key release not accepted by IM\n"); #endif } #endif @@ -1136,8 +1136,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) event->keyval == GDK_KEY_Alt_L || event->keyval == GDK_KEY_Alt_R)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - modifier press potentially begins Alt+numberpad " - "input\n")); + debug(" - modifier press potentially begins Alt+numberpad " + "input\n"); #endif inst->alt_keycode = -1; inst->alt_digits = 0; @@ -1176,8 +1176,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) inst->alt_keycode = inst->alt_keycode * 10 + digit; inst->alt_digits++; #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Alt+numberpad digit %d added to keycode %d" - " gives %d\n", digit, old_keycode, inst->alt_keycode)); + debug(" - Alt+numberpad digit %d added to keycode %d" + " gives %d\n", digit, old_keycode, inst->alt_keycode); #endif /* Having used this digit, we now do nothing more with it. */ goto done; @@ -1187,7 +1187,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) if (event->keyval == GDK_KEY_greater && (event->state & GDK_CONTROL_MASK)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl->: increase font size\n")); + debug(" - Ctrl->: increase font size\n"); #endif change_font_size(inst, +1); return true; @@ -1195,7 +1195,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) if (event->keyval == GDK_KEY_less && (event->state & GDK_CONTROL_MASK)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-<: increase font size\n")); + debug(" - Ctrl-<: increase font size\n"); #endif change_font_size(inst, -1); return true; @@ -1209,7 +1209,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) ((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK))) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Shift-PgUp scroll\n")); + debug(" - Ctrl-Shift-PgUp scroll\n"); #endif term_scroll(inst->term, 1, 0); return true; @@ -1217,7 +1217,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) if (event->keyval == GDK_KEY_Page_Up && (event->state & GDK_SHIFT_MASK)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Shift-PgUp scroll\n")); + debug(" - Shift-PgUp scroll\n"); #endif term_scroll(inst->term, 0, -inst->height/2); return true; @@ -1225,7 +1225,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) if (event->keyval == GDK_KEY_Page_Up && (event->state & GDK_CONTROL_MASK)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-PgUp scroll\n")); + debug(" - Ctrl-PgUp scroll\n"); #endif term_scroll(inst->term, 0, -1); return true; @@ -1234,7 +1234,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) ((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK))) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-shift-PgDn scroll\n")); + debug(" - Ctrl-shift-PgDn scroll\n"); #endif term_scroll(inst->term, -1, 0); return true; @@ -1242,7 +1242,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) if (event->keyval == GDK_KEY_Page_Down && (event->state & GDK_SHIFT_MASK)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Shift-PgDn scroll\n")); + debug(" - Shift-PgDn scroll\n"); #endif term_scroll(inst->term, 0, +inst->height/2); return true; @@ -1250,7 +1250,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) if (event->keyval == GDK_KEY_Page_Down && (event->state & GDK_CONTROL_MASK)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-PgDn scroll\n")); + debug(" - Ctrl-PgDn scroll\n"); #endif term_scroll(inst->term, 0, +1); return true; @@ -1266,25 +1266,25 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) switch (cfgval) { case CLIPUI_IMPLICIT: #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Shift-Insert: paste from PRIMARY\n")); + debug(" - Shift-Insert: paste from PRIMARY\n"); #endif term_request_paste(inst->term, CLIP_PRIMARY); return true; case CLIPUI_EXPLICIT: #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Shift-Insert: paste from CLIPBOARD\n")); + debug(" - Shift-Insert: paste from CLIPBOARD\n"); #endif term_request_paste(inst->term, CLIP_CLIPBOARD); return true; case CLIPUI_CUSTOM: #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Shift-Insert: paste from custom clipboard\n")); + debug(" - Shift-Insert: paste from custom clipboard\n"); #endif term_request_paste(inst->term, inst->clipboard_ctrlshiftins); return true; default: #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Shift-Insert: no paste action\n")); + debug(" - Shift-Insert: no paste action\n"); #endif break; } @@ -1298,26 +1298,26 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) case CLIPUI_IMPLICIT: /* do nothing; re-copy to PRIMARY is not needed */ #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Insert: non-copy to PRIMARY\n")); + debug(" - Ctrl-Insert: non-copy to PRIMARY\n"); #endif return true; case CLIPUI_EXPLICIT: #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Insert: copy to CLIPBOARD\n")); + debug(" - Ctrl-Insert: copy to CLIPBOARD\n"); #endif term_request_copy(inst->term, clips_clipboard, lenof(clips_clipboard)); return true; case CLIPUI_CUSTOM: #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Insert: copy to custom clipboard\n")); + debug(" - Ctrl-Insert: copy to custom clipboard\n"); #endif term_request_copy(inst->term, &inst->clipboard_ctrlshiftins, 1); return true; default: #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Insert: no copy action\n")); + debug(" - Ctrl-Insert: no copy action\n"); #endif break; } @@ -1338,25 +1338,25 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) case CLIPUI_IMPLICIT: if (paste) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Shift-V: paste from PRIMARY\n")); + debug(" - Ctrl-Shift-V: paste from PRIMARY\n"); #endif term_request_paste(inst->term, CLIP_PRIMARY); } else { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Shift-C: non-copy to PRIMARY\n")); + debug(" - Ctrl-Shift-C: non-copy to PRIMARY\n"); #endif } return true; case CLIPUI_EXPLICIT: if (paste) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Shift-V: paste from CLIPBOARD\n")); + debug(" - Ctrl-Shift-V: paste from CLIPBOARD\n"); #endif term_request_paste(inst->term, CLIP_CLIPBOARD); } else { static const int clips[] = { CLIP_CLIPBOARD }; #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Shift-C: copy to CLIPBOARD\n")); + debug(" - Ctrl-Shift-C: copy to CLIPBOARD\n"); #endif term_request_copy(inst->term, clips, lenof(clips)); } @@ -1364,13 +1364,13 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) case CLIPUI_CUSTOM: if (paste) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Shift-V: paste from custom clipboard\n")); + debug(" - Ctrl-Shift-V: paste from custom clipboard\n"); #endif term_request_paste(inst->term, inst->clipboard_ctrlshiftcv); } else { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Shift-C: copy to custom clipboard\n")); + debug(" - Ctrl-Shift-C: copy to custom clipboard\n"); #endif term_request_copy(inst->term, &inst->clipboard_ctrlshiftcv, 1); @@ -1458,8 +1458,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) * something not what we wanted). */ #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Meta modifier requiring manual intervention, " - "suppressing IM filtering\n")); + debug(" - Meta modifier requiring manual intervention, " + "suppressing IM filtering\n"); #endif try_filter = false; } @@ -1467,16 +1467,16 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) if (try_filter) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - general key press, passing to IM\n")); + debug(" - general key press, passing to IM\n"); #endif if (gtk_im_context_filter_keypress(inst->imc, event)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - key press accepted by IM\n")); + debug(" - key press accepted by IM\n"); #endif return true; } else { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - key press not accepted by IM\n")); + debug(" - key press not accepted by IM\n"); #endif } } @@ -1517,8 +1517,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) (unsigned)widedata[i]); sfree(old); } - debug((" - string translated into Unicode = [%s]\n", - string_string)); + debug(" - string translated into Unicode = [%s]\n", + string_string); sfree(string_string); } #endif @@ -1539,8 +1539,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) (unsigned)output[i+1] & 0xFF); sfree(old); } - debug((" - string translated into UTF-8 = [%s]\n", - string_string)); + debug(" - string translated into UTF-8 = [%s]\n", + string_string); sfree(string_string); } #endif @@ -1554,8 +1554,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) ucsoutput[0] = '\033'; ucsoutput[1] = ucsval; #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - keysym_to_unicode gave %04x\n", - (unsigned)ucsoutput[1])); + debug(" - keysym_to_unicode gave %04x\n", + (unsigned)ucsoutput[1]); #endif use_ucsoutput = true; end = 2; @@ -1591,9 +1591,9 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) #ifdef KEY_EVENT_DIAGNOSTICS { char *keyval_name = dup_keyval_name(new_keyval); - debug((" - retranslation for manual Meta: " - "new keyval = %s, Unicode = %04x\n", - keyval_name, (unsigned)ucsoutput[1])); + debug(" - retranslation for manual Meta: " + "new keyval = %s, Unicode = %04x\n", + keyval_name, (unsigned)ucsoutput[1]); sfree(keyval_name); } #endif @@ -1609,7 +1609,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) if (!output[1] && event->keyval == '`' && (event->state & GDK_CONTROL_MASK)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-` special case, translating as 1c\n")); + debug(" - Ctrl-` special case, translating as 1c\n"); #endif output[1] = '\x1C'; use_ucsoutput = false; @@ -1648,10 +1648,10 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) #ifdef KEY_EVENT_DIAGNOSTICS if (orig == output[1]) - debug((" - manual Ctrl key handling did nothing\n")); + debug(" - manual Ctrl key handling did nothing\n"); else - debug((" - manual Ctrl key handling: %02x -> %02x\n", - (unsigned)orig, (unsigned)output[1])); + debug(" - manual Ctrl key handling: %02x -> %02x\n", + (unsigned)orig, (unsigned)output[1]); #endif } @@ -1659,7 +1659,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) if (event->keyval == GDK_KEY_Break && (event->state & GDK_CONTROL_MASK)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Break special case, sending SS_BRK\n")); + debug(" - Ctrl-Break special case, sending SS_BRK\n"); #endif if (inst->backend) backend_special(inst->backend, SS_BRK, 0); @@ -1670,7 +1670,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) * special to ldisc. */ if (event->keyval == GDK_KEY_Return) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Return special case, translating as 0d + special\n")); + debug(" - Return special case, translating as 0d + special\n"); #endif output[1] = '\015'; use_ucsoutput = false; @@ -1685,7 +1685,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) (event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) == GDK_CONTROL_MASK) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-{space,2,@} special case, translating as 00\n")); + debug(" - Ctrl-{space,2,@} special case, translating as 00\n"); #endif output[1] = '\0'; use_ucsoutput = false; @@ -1697,7 +1697,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) (event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) == (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Ctrl-Shift-space special case, translating as 00a0\n")); + debug(" - Ctrl-Shift-space special case, translating as 00a0\n"); #endif output[1] = '\240'; output_charset = CS_ISO8859_1; @@ -1711,8 +1711,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) output[1] = conf_get_bool(inst->conf, CONF_bksp_is_delete) ? '\x7F' : '\x08'; #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Backspace, translating as %02x\n", - (unsigned)output[1])); + debug(" - Backspace, translating as %02x\n", + (unsigned)output[1]); #endif use_ucsoutput = false; end = 2; @@ -1724,8 +1724,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) output[1] = conf_get_bool(inst->conf, CONF_bksp_is_delete) ? '\x08' : '\x7F'; #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Shift-Backspace, translating as %02x\n", - (unsigned)output[1])); + debug(" - Shift-Backspace, translating as %02x\n", + (unsigned)output[1]); #endif use_ucsoutput = false; end = 2; @@ -1737,7 +1737,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) (event->keyval == GDK_KEY_Tab && (event->state & GDK_SHIFT_MASK))) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Shift-Tab, translating as ESC [ Z\n")); + debug(" - Shift-Tab, translating as ESC [ Z\n"); #endif end = 1 + sprintf(output+1, "\033[Z"); use_ucsoutput = false; @@ -1747,7 +1747,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) * doesn't translate Tab for us. */ if (event->keyval == GDK_KEY_Tab && end <= 1) { #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - Tab, translating as 09\n")); + debug(" - Tab, translating as 09\n"); #endif output[1] = '\t'; end = 2; @@ -1759,7 +1759,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) event->state & GDK_SHIFT_MASK, event->state & GDK_CONTROL_MASK); #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - numeric keypad key")); + debug(" - numeric keypad key"); #endif use_ucsoutput = false; goto done; @@ -1792,7 +1792,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) event->state & GDK_SHIFT_MASK, event->state & GDK_CONTROL_MASK); #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - function key F%d", fkey_number)); + debug(" - function key F%d", fkey_number); #endif use_ucsoutput = false; goto done; @@ -1817,7 +1817,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) end = 1 + format_small_keypad_key(output+1, inst->term, sk_key); #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - small keypad key")); + debug(" - small keypad key"); #endif use_ucsoutput = false; goto done; @@ -1837,7 +1837,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) end = 1 + format_arrow_key(output+1, inst->term, xkey, event->state & GDK_CONTROL_MASK); #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - arrow key")); + debug(" - arrow key"); #endif use_ucsoutput = false; goto done; @@ -1849,7 +1849,7 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) event->state & GDK_SHIFT_MASK, event->state & GDK_CONTROL_MASK); #ifdef KEY_EVENT_DIAGNOSTICS - debug((" - numeric keypad key")); + debug(" - numeric keypad key"); #endif use_ucsoutput = false; goto done; @@ -1873,8 +1873,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) (unsigned)output[i] & 0xFF); sfree(old); } - debug((" - final output, special, generic encoding = [%s]\n", - charset_to_localenc(output_charset), string_string)); + debug(" - final output, special, generic encoding = [%s]\n", + charset_to_localenc(output_charset), string_string); sfree(string_string); #endif /* @@ -1898,8 +1898,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) (unsigned)output[i] & 0xFF); sfree(old); } - debug((" - final output in %s = [%s]\n", - charset_to_localenc(output_charset), string_string)); + debug(" - final output in %s = [%s]\n", + charset_to_localenc(output_charset), string_string); sfree(string_string); #endif generated_something = true; @@ -1918,8 +1918,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) (unsigned)ucsoutput[i]); sfree(old); } - debug((" - final output in Unicode = [%s]\n", - string_string)); + debug(" - final output in Unicode = [%s]\n", + string_string); sfree(string_string); #endif @@ -1947,8 +1947,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) (unsigned)output[i] & 0xFF); sfree(old); } - debug((" - final output in direct-to-font encoding = [%s]\n", - string_string)); + debug(" - final output in direct-to-font encoding = [%s]\n", + string_string); sfree(string_string); #endif generated_something = true; @@ -1981,7 +1981,7 @@ void input_method_commit_event(GtkIMContext *imc, gchar *str, gpointer data) (unsigned)str[i] & 0xFF); sfree(old); } - debug((" - IM commit event in UTF-8 = [%s]\n", string_string)); + debug(" - IM commit event in UTF-8 = [%s]\n", string_string); sfree(string_string); #endif diff --git a/unix/uxnet.c b/unix/uxnet.c index f911d83e..a676656a 100644 --- a/unix/uxnet.c +++ b/unix/uxnet.c @@ -237,7 +237,7 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname, int address_fami * we don't use gethostbyname as a fallback!) */ if (ret->superfamily == UNRESOLVED) { - /*debug(("Resolving \"%s\" with gethostbyname() (IPv4 only)...\n", host)); */ + /*debug("Resolving \"%s\" with gethostbyname() (IPv4 only)...\n", host); */ if ( (h = gethostbyname(host)) ) ret->superfamily = IP; } diff --git a/windows/window.c b/windows/window.c index 3a8de2fe..f579f960 100644 --- a/windows/window.c +++ b/windows/window.c @@ -1548,8 +1548,8 @@ static void init_fonts(int pick_width, int pick_height) } #ifdef RDB_DEBUG_PATCH - debug(23, "Primary font H=%d, AW=%d, MW=%d", - tm.tmHeight, tm.tmAveCharWidth, tm.tmMaxCharWidth); + debug("Primary font H=%d, AW=%d, MW=%d\n", + tm.tmHeight, tm.tmAveCharWidth, tm.tmMaxCharWidth); #endif { @@ -1796,7 +1796,7 @@ static void reset_window(int reinit) { RECT cr, wr; #ifdef RDB_DEBUG_PATCH - debug((27, "reset_window()")); + debug("reset_window()\n"); #endif /* Current window sizes ... */ @@ -1815,7 +1815,7 @@ static void reset_window(int reinit) { /* Are we being forced to reload the fonts ? */ if (reinit>1) { #ifdef RDB_DEBUG_PATCH - debug((27, "reset_window() -- Forced deinit")); + debug("reset_window() -- Forced deinit\n"); #endif deinit_fonts(); init_fonts(0,0); @@ -1833,7 +1833,7 @@ static void reset_window(int reinit) { offset_height = (win_height-font_height*term->rows)/2; InvalidateRect(hwnd, NULL, true); #ifdef RDB_DEBUG_PATCH - debug((27, "reset_window() -> Reposition terminal")); + debug("reset_window() -> Reposition terminal\n"); #endif } @@ -1854,8 +1854,8 @@ static void reset_window(int reinit) { offset_height = (win_height-font_height*term->rows)/2; InvalidateRect(hwnd, NULL, true); #ifdef RDB_DEBUG_PATCH - debug((25, "reset_window() -> Z font resize to (%d, %d)", - font_width, font_height)); + debug("reset_window() -> Z font resize to (%d, %d)\n", + font_width, font_height); #endif } } else { @@ -1870,7 +1870,7 @@ static void reset_window(int reinit) { offset_height = (win_height-font_height*term->rows)/2; InvalidateRect(hwnd, NULL, true); #ifdef RDB_DEBUG_PATCH - debug((27, "reset_window() -> Zoomed term_size")); + debug("reset_window() -> Zoomed term_size\n"); #endif } } @@ -1882,7 +1882,7 @@ static void reset_window(int reinit) { */ if (reinit>0) { #ifdef RDB_DEBUG_PATCH - debug((27, "reset_window() -> Forced re-init")); + debug("reset_window() -> Forced re-init\n"); #endif offset_width = offset_height = window_border; @@ -1950,8 +1950,8 @@ static void reset_window(int reinit) { term_size(term, height, width, conf_get_int(conf, CONF_savelines)); #ifdef RDB_DEBUG_PATCH - debug((27, "reset_window() -> term resize to (%d,%d)", - height, width)); + debug("reset_window() -> term resize to (%d,%d)\n", + height, width); #endif } } @@ -1963,9 +1963,9 @@ static void reset_window(int reinit) { InvalidateRect(hwnd, NULL, true); #ifdef RDB_DEBUG_PATCH - debug((27, "reset_window() -> window resize to (%d,%d)", - font_width*term->cols + extra_width, - font_height*term->rows + extra_height)); + debug("reset_window() -> window resize to (%d,%d)\n", + font_width*term->cols + extra_width, + font_height*term->rows + extra_height); #endif } return; @@ -1987,8 +1987,8 @@ static void reset_window(int reinit) { InvalidateRect(hwnd, NULL, true); #ifdef RDB_DEBUG_PATCH - debug((25, "reset_window() -> font resize to (%d,%d)", - font_width, font_height)); + debug("reset_window() -> font resize to (%d,%d)\n", + font_width, font_height); #endif } } @@ -2862,7 +2862,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, break; case WM_ENTERSIZEMOVE: #ifdef RDB_DEBUG_PATCH - debug((27, "WM_ENTERSIZEMOVE")); + debug("WM_ENTERSIZEMOVE\n"); #endif EnableSizeTip(true); resizing = true; @@ -2872,7 +2872,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, EnableSizeTip(false); resizing = false; #ifdef RDB_DEBUG_PATCH - debug((27, "WM_EXITSIZEMOVE")); + debug("WM_EXITSIZEMOVE\n"); #endif if (need_backend_resize) { term_size(term, conf_get_int(conf, CONF_height), @@ -2983,13 +2983,13 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, case WM_SIZE: resize_action = conf_get_int(conf, CONF_resize_action); #ifdef RDB_DEBUG_PATCH - debug((27, "WM_SIZE %s (%d,%d)", - (wParam == SIZE_MINIMIZED) ? "SIZE_MINIMIZED": - (wParam == SIZE_MAXIMIZED) ? "SIZE_MAXIMIZED": - (wParam == SIZE_RESTORED && resizing) ? "to": - (wParam == SIZE_RESTORED) ? "SIZE_RESTORED": - "...", - LOWORD(lParam), HIWORD(lParam))); + debug("WM_SIZE %s (%d,%d)\n", + (wParam == SIZE_MINIMIZED) ? "SIZE_MINIMIZED": + (wParam == SIZE_MAXIMIZED) ? "SIZE_MAXIMIZED": + (wParam == SIZE_RESTORED && resizing) ? "to": + (wParam == SIZE_RESTORED) ? "SIZE_RESTORED": + "...", + LOWORD(lParam), HIWORD(lParam)); #endif if (wParam == SIZE_MINIMIZED) SetWindowText(hwnd, @@ -4098,53 +4098,53 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, first = 0; if ((HIWORD(lParam) & (KF_UP | KF_REPEAT)) == KF_REPEAT) { - debug(("+")); + debug("+"); } else if ((HIWORD(lParam) & KF_UP) && scan == (HIWORD(lParam) & 0xFF)) { - debug((". U")); + debug(". U"); } else { - debug((".\n")); + debug(".\n"); if (wParam >= VK_F1 && wParam <= VK_F20) - debug(("K_F%d", wParam + 1 - VK_F1)); + debug("K_F%d", wParam + 1 - VK_F1); else switch (wParam) { case VK_SHIFT: - debug(("SHIFT")); + debug("SHIFT"); break; case VK_CONTROL: - debug(("CTRL")); + debug("CTRL"); break; case VK_MENU: - debug(("ALT")); + debug("ALT"); break; default: - debug(("VK_%02x", wParam)); + debug("VK_%02x", wParam); } if (message == WM_SYSKEYDOWN || message == WM_SYSKEYUP) - debug(("*")); - debug((", S%02x", scan = (HIWORD(lParam) & 0xFF))); + debug("*"); + debug(", S%02x", scan = (HIWORD(lParam) & 0xFF)); ch = MapVirtualKeyEx(wParam, 2, kbd_layout); if (ch >= ' ' && ch <= '~') - debug((", '%c'", ch)); + debug(", '%c'", ch); else if (ch) - debug((", $%02x", ch)); + debug(", $%02x", ch); if (keys_unicode[0]) - debug((", KB0=%04x", keys_unicode[0])); + debug(", KB0=%04x", keys_unicode[0]); if (keys_unicode[1]) - debug((", KB1=%04x", keys_unicode[1])); + debug(", KB1=%04x", keys_unicode[1]); if (keys_unicode[2]) - debug((", KB2=%04x", keys_unicode[2])); + debug(", KB2=%04x", keys_unicode[2]); if ((keystate[VK_SHIFT] & 0x80) != 0) - debug((", S")); + debug(", S"); if ((keystate[VK_CONTROL] & 0x80) != 0) - debug((", C")); + debug(", C"); if ((HIWORD(lParam) & KF_EXTENDED)) - debug((", E")); + debug(", E"); if ((HIWORD(lParam) & KF_UP)) - debug((", U")); + debug(", U"); } if ((HIWORD(lParam) & (KF_UP | KF_REPEAT)) == KF_REPEAT); @@ -4155,7 +4155,7 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, for (ch = 0; ch < 256; ch++) if (oldstate[ch] != keystate[ch]) - debug((", M%02x=%02x", ch, keystate[ch])); + debug(", M%02x=%02x", ch, keystate[ch]); memcpy(oldstate, keystate, sizeof(oldstate)); } @@ -4588,19 +4588,19 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, if (r == 1 && !key_down) { if (alt_sum) { if (in_utf(term) || ucsdata.dbcs_screenfont) - debug((", (U+%04x)", alt_sum)); + debug(", (U+%04x)", alt_sum); else - debug((", LCH(%d)", alt_sum)); + debug(", LCH(%d)", alt_sum); } else { - debug((", ACH(%d)", keys_unicode[0])); + debug(", ACH(%d)", keys_unicode[0]); } } else if (r > 0) { int r1; - debug((", ASC(")); + debug(", ASC("); for (r1 = 0; r1 < r; r1++) { - debug(("%s%d", r1 ? "," : "", keys_unicode[r1])); + debug("%s%d", r1 ? "," : "", keys_unicode[r1]); } - debug((")")); + debug(")"); } #endif if (r > 0) { diff --git a/windows/winpgnt.c b/windows/winpgnt.c index bf84e863..29e9cacf 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -794,7 +794,7 @@ static char *answer_filemapping_message(const char *mapname) reply.buf = NULL; #ifdef DEBUG_IPC - debug(("mapname = \"%s\"\n", mapname)); + debug("mapname = \"%s\"\n", mapname); #endif maphandle = OpenFileMapping(FILE_MAP_ALL_ACCESS, false, mapname); @@ -805,7 +805,7 @@ static char *answer_filemapping_message(const char *mapname) } #ifdef DEBUG_IPC - debug(("maphandle = %p\n", maphandle)); + debug("maphandle = %p\n", maphandle); #endif #ifndef NO_SECURITY @@ -837,8 +837,8 @@ static char *answer_filemapping_message(const char *mapname) ConvertSidToStringSid(mapsid, &theirs); ConvertSidToStringSid(expectedsid, &ours); ConvertSidToStringSid(expectedsid_bc, &ours2); - debug(("got sids:\n oursnew=%s\n oursold=%s\n" - " theirs=%s\n", ours, ours2, theirs)); + debug("got sids:\n oursnew=%s\n oursold=%s\n" + " theirs=%s\n", ours, ours2, theirs); LocalFree(ours); LocalFree(ours2); LocalFree(theirs); @@ -854,7 +854,7 @@ static char *answer_filemapping_message(const char *mapname) #endif /* NO_SECURITY */ { #ifdef DEBUG_IPC - debug(("security APIs not present\n")); + debug("security APIs not present\n"); #endif } @@ -866,7 +866,7 @@ static char *answer_filemapping_message(const char *mapname) } #ifdef DEBUG_IPC - debug(("mapped address = %p\n", mapaddr)); + debug("mapped address = %p\n", mapaddr); #endif { @@ -887,7 +887,7 @@ static char *answer_filemapping_message(const char *mapname) mapsize = mbi.RegionSize; } #ifdef DEBUG_IPC - debug(("region size = %zd\n", mapsize)); + debug("region size = %zd\n", mapsize); #endif if (mapsize < 5) { err = dupstr("mapping smaller than smallest possible request"); @@ -897,8 +897,8 @@ static char *answer_filemapping_message(const char *mapname) msglen = GET_32BIT((unsigned char *)mapaddr); #ifdef DEBUG_IPC - debug(("msg length=%08x, msg type=%02x\n", - msglen, (unsigned)((unsigned char *) mapaddr)[4])); + debug("msg length=%08x, msg type=%02x\n", + msglen, (unsigned)((unsigned char *) mapaddr)[4]); #endif reply.buf = (char *)mapaddr + 4; @@ -1095,7 +1095,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, err = answer_filemapping_message(mapname); if (err) { #ifdef DEBUG_IPC - debug(("IPC failed: %s\n", err)); + debug("IPC failed: %s\n", err); #endif sfree(err); return 0; diff --git a/windows/winucs.c b/windows/winucs.c index 7195081a..eeafc83e 100644 --- a/windows/winucs.c +++ b/windows/winucs.c @@ -504,15 +504,14 @@ void init_ucs(Conf *conf, struct unicode_data *ucsdata) } #if 0 - debug( - ("Line cp%d, Font cp%d%s\n", ucsdata->line_codepage, - ucsdata->font_codepage, ucsdata->dbcs_screenfont ? " DBCS" : "")); + debug("Line cp%d, Font cp%d%s\n", ucsdata->line_codepage, + ucsdata->font_codepage, ucsdata->dbcs_screenfont ? " DBCS" : ""); for (i = 0; i < 256; i += 16) { for (j = 0; j < 16; j++) { - debug(("%04x%s", ucsdata->unitab_line[i + j], j == 15 ? "" : ",")); + debug("%04x%s", ucsdata->unitab_line[i + j], j == 15 ? "" : ","); } - debug(("\n")); + debug("\n"); } #endif