[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Remove extra newlines from log/error messages


On Wednesday, 12 October 2016 11:29:02 CEST Pino Toscano wrote:
> Signed-off-by: Pino Toscano <ptoscano@xxxxxxxxxx>

Pushed to master. Thanks for your contribution!

> ---
> 
> This patch was based on v0-7 branch, not on master.
> 
>  src/channels1.c  | 4 ++--
>  src/config.c     | 4 ++--
>  src/connect.c    | 6 +++---
>  src/gssapi.c     | 4 ++--
>  src/kex1.c       | 2 +-
>  src/options.c    | 2 +-
>  src/sftpserver.c | 2 +-
>  src/wrapper.c    | 4 ++--
>  8 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/src/channels1.c b/src/channels1.c
> index 4b7d268..71924ca 100644
> --- a/src/channels1.c
> +++ b/src/channels1.c
> @@ -151,7 +151,7 @@ int channel_request_pty_size1(ssh_channel channel, const
> char *terminal, int col channel->request_state=SSH_CHANNEL_REQ_STATE_NONE;
>        ssh_set_error(session, SSH_REQUEST_DENIED,
>            "Server denied PTY allocation");
> -      SSH_LOG(SSH_LOG_RARE, "PTY: denied\n");
> +      SSH_LOG(SSH_LOG_RARE, "PTY: denied");
>        return SSH_ERROR;
>    }
>    // Not reached
> @@ -270,7 +270,7 @@ SSH_PACKET_CALLBACK(ssh_packet_data1){
> 
>      str = buffer_get_ssh_string(packet);
>      if (str == NULL) {
> -      SSH_LOG(SSH_LOG_FUNCTIONS, "Invalid data packet !\n");
> +      SSH_LOG(SSH_LOG_FUNCTIONS, "Invalid data packet !");
>        return SSH_PACKET_USED;
>      }
> 
> diff --git a/src/config.c b/src/config.c
> index edbaf80..aa315f7 100644
> --- a/src/config.c
> +++ b/src/config.c
> @@ -361,11 +361,11 @@ static int ssh_config_parse_line(ssh_session session,
> const char *line, }
>        break;
>      case SOC_UNSUPPORTED:
> -      SSH_LOG(SSH_LOG_RARE, "Unsupported option: %s, line: %d\n",
> +      SSH_LOG(SSH_LOG_RARE, "Unsupported option: %s, line: %d",
>                keyword, count);
>        break;
>      default:
> -      ssh_set_error(session, SSH_FATAL, "ERROR - unimplemented opcode:
> %d\n", +      ssh_set_error(session, SSH_FATAL, "ERROR - unimplemented
> opcode: %d", opcode);
>        SAFE_FREE(x);
>        return -1;
> diff --git a/src/connect.c b/src/connect.c
> index e0722a7..50c9e99 100644
> --- a/src/connect.c
> +++ b/src/connect.c
> @@ -203,7 +203,7 @@ static int ssh_connect_ai_timeout(ssh_session session,
> const char *host, }
> 
>    /* s is connected ? */
> -  SSH_LOG(SSH_LOG_PACKET, "Socket connected with timeout\n");
> +  SSH_LOG(SSH_LOG_PACKET, "Socket connected with timeout");
>    ret = ssh_socket_set_blocking(s);
>    if (ret < 0) {
>        ssh_set_error(session, SSH_FATAL,
> @@ -252,7 +252,7 @@ socket_t ssh_connect_host(ssh_session session, const
> char *host, struct addrinfo *bind_ai;
>        struct addrinfo *bind_itr;
> 
> -      SSH_LOG(SSH_LOG_PACKET, "Resolving %s\n", bind_addr);
> +      SSH_LOG(SSH_LOG_PACKET, "Resolving %s", bind_addr);
> 
>        rc = getai(bind_addr, 0, &bind_ai);
>        if (rc != 0) {
> @@ -346,7 +346,7 @@ socket_t ssh_connect_host_nonblocking(ssh_session
> session, const char *host, struct addrinfo *bind_ai;
>        struct addrinfo *bind_itr;
> 
> -      SSH_LOG(SSH_LOG_PACKET, "Resolving %s\n", bind_addr);
> +      SSH_LOG(SSH_LOG_PACKET, "Resolving %s", bind_addr);
> 
>        rc = getai(bind_addr, 0, &bind_ai);
>        if (rc != 0) {
> diff --git a/src/gssapi.c b/src/gssapi.c
> index c2b30f6..431be11 100644
> --- a/src/gssapi.c
> +++ b/src/gssapi.c
> @@ -218,7 +218,7 @@ int ssh_gssapi_handle_userauth(ssh_session session,
> const char *user, uint32_t n maj_stat = gss_indicate_mechs(&min_stat,
> &supported);
>      for (i=0; i < supported->count; ++i){
>          ptr = ssh_get_hexa(supported->elements[i].elements,
> supported->elements[i].length); -        SSH_LOG(SSH_LOG_DEBUG, "Supported
> mech %d: %s\n", i, ptr); +        SSH_LOG(SSH_LOG_DEBUG, "Supported mech
> %d: %s", i, ptr);
>          free(ptr);
>      }
> 
> @@ -664,7 +664,7 @@ static int ssh_gssapi_match(ssh_session session,
> gss_OID_set *valid_oids) if (maj_stat == GSS_S_COMPLETE && lifetime > 0) {
>              gss_add_oid_set_member(&min_stat, oid, valid_oids);
>              ptr = ssh_get_hexa(oid->elements, oid->length);
> -            SSH_LOG(SSH_LOG_DEBUG, "GSSAPI valid oid %d : %s\n", i, ptr);
> +            SSH_LOG(SSH_LOG_DEBUG, "GSSAPI valid oid %d : %s", i, ptr);
>              SAFE_FREE(ptr);
>          }
>      }
> diff --git a/src/kex1.c b/src/kex1.c
> index 758054f..16f577c 100644
> --- a/src/kex1.c
> +++ b/src/kex1.c
> @@ -491,7 +491,7 @@ int ssh_get_kex1(ssh_session session) {
>    if(session->session_state==SSH_SESSION_STATE_ERROR) {
>        return SSH_ERROR;
>    }
> -  SSH_LOG(SSH_LOG_PROTOCOL, "received SSH_SMSG_SUCCESS\n");
> +  SSH_LOG(SSH_LOG_PROTOCOL, "received SSH_SMSG_SUCCESS");
> 
>    return SSH_OK;
>  }
> diff --git a/src/options.c b/src/options.c
> index 2c4baf6..f91cce5 100644
> --- a/src/options.c
> +++ b/src/options.c
> @@ -166,7 +166,7 @@ int ssh_options_set_algo(ssh_session session, int algo,
>      const char *list) {
>    if (!verify_existing_algo(algo, list)) {
>      ssh_set_error(session, SSH_REQUEST_DENIED,
> -        "Setting method: no algorithm for method \"%s\" (%s)\n",
> +        "Setting method: no algorithm for method \"%s\" (%s)",
>          ssh_kex_get_description(algo), list);
>      return -1;
>    }
> diff --git a/src/sftpserver.c b/src/sftpserver.c
> index 6049879..1b27b98 100644
> --- a/src/sftpserver.c
> +++ b/src/sftpserver.c
> @@ -205,7 +205,7 @@ sftp_client_message sftp_get_client_message(sftp_session
> sftp) { break;
>      default:
>        ssh_set_error(sftp->session, SSH_FATAL,
> -                    "Received unhandled sftp message %d\n", msg->type);
> +                    "Received unhandled sftp message %d", msg->type);
>        sftp_client_message_free(msg);
>        return NULL;
>    }
> diff --git a/src/wrapper.c b/src/wrapper.c
> index b750702..adc693b 100644
> --- a/src/wrapper.c
> +++ b/src/wrapper.c
> @@ -451,11 +451,11 @@ int crypt_set_algorithms_server(ssh_session session){
> 
>      method = session->next_crypto->kex_methods[SSH_COMP_S_C];
>      if(strcmp(method,"zlib") == 0){
> -        SSH_LOG(SSH_LOG_PACKET, "enabling S->C compression\n");
> +        SSH_LOG(SSH_LOG_PACKET, "enabling S->C compression");
>          session->next_crypto->do_compress_out=1;
>      }
>      if(strcmp(method,"zlib@xxxxxxxxxxx") == 0){
> -        SSH_LOG(SSH_LOG_PACKET,"enabling S->C delayed compression\n");
> +        SSH_LOG(SSH_LOG_PACKET,"enabling S->C delayed compression");
> 
>          if (session->flags & SSH_SESSION_FLAG_AUTHENTICATED) {
>              session->next_crypto->do_compress_out = 1;


-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx

References:
[PATCH] Remove extra newlines from log/error messagesPino Toscano <ptoscano@xxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org