diff --git a/appveyor.yml b/appveyor.yml index 5c5f3e08..94337371 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -187,9 +187,9 @@ test_script: if((Get-Process -Name "sshd" -ErrorAction SilentlyContinue).Count -gt 1) { $env:DOCKER_HOST = "tcp://127.0.0.1:2375" [System.Environment]::SetEnvironmentVariable("DOCKER_HOST", $env:DOCKER_HOST) - Write-Host "... ready!" + Write-Host "... ready." } else { - Write-Host "... failed!" + Write-Host "... failed." } if($env:CRYPTO_BACKEND -eq "WinCNG") { $env:FIXTURE_TRACE_ALL_CONNECT = "1" diff --git a/configure.ac b/configure.ac index 15e33195..959f26b5 100644 --- a/configure.ac +++ b/configure.ac @@ -105,10 +105,10 @@ case "${use_crypto}" in m4_set_map([crypto_backends], [LIBSSH2_CHECK_CRYPTO]) ;; yes|"") - crypto_errors="No crypto backend specified!" + crypto_errors="No crypto backend specified." ;; *) - crypto_errors="Unknown crypto backend '${use_crypto}' specified!" + crypto_errors="Unknown crypto backend '${use_crypto}' specified." ;; esac @@ -139,7 +139,7 @@ if test "$use_libz" != no; then AC_MSG_NOTICE([Cannot find libz, disabling compression]) found_libz="disabled; no libz found" else - libz_errors="No libz found! + libz_errors="No libz found. Try --with-libz-prefix=PATH if you know that you have it." AS_MESSAGE([ERROR: $libz_errors]) fi @@ -365,7 +365,7 @@ if test "$found_crypto" = "none"; then fi if test $missing_required_deps = 1; then - AC_MSG_ERROR([Required dependencies are missing!]) + AC_MSG_ERROR([Required dependencies are missing.]) fi AM_CONDITIONAL([HAVE_WINDRES], diff --git a/docs/libssh2_version.3 b/docs/libssh2_version.3 index 6bd49036..02749b85 100644 --- a/docs/libssh2_version.3 +++ b/docs/libssh2_version.3 @@ -25,7 +25,7 @@ To make sure you run with the correct libssh2 version: .nf if(!libssh2_version(LIBSSH2_VERSION_NUM)) { - fprintf(stderr, \&"Runtime libssh2 version too old!\&"); + fprintf(stderr, \&"Runtime libssh2 version too old.\&"); exit(1); } .fi diff --git a/example/direct_tcpip.c b/example/direct_tcpip.c index 3dee2697..c2841f89 100644 --- a/example/direct_tcpip.c +++ b/example/direct_tcpip.c @@ -104,26 +104,26 @@ int main(int argc, char *argv[]) /* Connect to SSH server */ sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to open socket!\n"); + fprintf(stderr, "failed to open socket.\n"); goto shutdown; } sin.sin_family = AF_INET; sin.sin_addr.s_addr = inet_addr(server_ip); if(INADDR_NONE == sin.sin_addr.s_addr) { - fprintf(stderr, "inet_addr: Invalid IP address \"%s\"\n", server_ip); + fprintf(stderr, "inet_addr: Invalid IP address '%s'\n", server_ip); goto shutdown; } sin.sin_port = htons(22); if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "Failed to connect to %s!\n", inet_ntoa(sin.sin_addr)); + fprintf(stderr, "Failed to connect to %s.\n", inet_ntoa(sin.sin_addr)); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -167,7 +167,7 @@ int main(int argc, char *argv[]) if(auth & AUTH_PASSWORD) { if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } else { @@ -183,14 +183,14 @@ int main(int argc, char *argv[]) } } else { - fprintf(stderr, "No supported authentication methods found!\n"); + fprintf(stderr, "No supported authentication methods found.\n"); goto shutdown; } } listensock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if(listensock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to open listen socket!\n"); + fprintf(stderr, "failed to open listen socket.\n"); goto shutdown; } @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) sin.sin_port = htons((unsigned short)local_listenport); sin.sin_addr.s_addr = inet_addr(local_listenip); if(INADDR_NONE == sin.sin_addr.s_addr) { - fprintf(stderr, "failed in inet_addr()!\n"); + fprintf(stderr, "failed in inet_addr().\n"); goto shutdown; } sockopt = 1; @@ -206,11 +206,11 @@ int main(int argc, char *argv[]) sizeof(sockopt)); sinlen = sizeof(sin); if(-1 == bind(listensock, (struct sockaddr *)&sin, sinlen)) { - fprintf(stderr, "failed to bind()!\n"); + fprintf(stderr, "failed to bind().\n"); goto shutdown; } if(-1 == listen(listensock, 2)) { - fprintf(stderr, "failed to listen()!\n"); + fprintf(stderr, "failed to listen().\n"); goto shutdown; } @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) forwardsock = accept(listensock, (struct sockaddr *)&sin, &sinlen); if(forwardsock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to accept forward socket!\n"); + fprintf(stderr, "failed to accept forward socket.\n"); goto shutdown; } @@ -232,8 +232,8 @@ int main(int argc, char *argv[]) channel = libssh2_channel_direct_tcpip_ex(session, remote_desthost, remote_destport, shost, sport); if(!channel) { - fprintf(stderr, "Could not open the direct-tcpip channel!\n" - "(Note that this can be a problem at the server!" + fprintf(stderr, "Could not open the direct-tcpip channel.\n" + "(Note that this can be a problem at the server." " Please review the server logs.)\n"); goto shutdown; } @@ -248,17 +248,17 @@ int main(int argc, char *argv[]) tv.tv_usec = 100000; rc = select((int)(forwardsock + 1), &fds, NULL, NULL, &tv); if(-1 == rc) { - fprintf(stderr, "failed to select()!\n"); + fprintf(stderr, "failed to select().\n"); goto shutdown; } if(rc && FD_ISSET(forwardsock, &fds)) { len = recv(forwardsock, buf, sizeof(buf), 0); if(len < 0) { - fprintf(stderr, "failed to recv()!\n"); + fprintf(stderr, "failed to recv().\n"); goto shutdown; } else if(len == 0) { - fprintf(stderr, "The client at %s:%d disconnected!\n", shost, + fprintf(stderr, "The client at %s:%d disconnected.\n", shost, sport); goto shutdown; } @@ -289,13 +289,13 @@ int main(int argc, char *argv[]) while(wr < len) { ssize_t nsent = send(forwardsock, buf + wr, len - wr, 0); if(nsent <= 0) { - fprintf(stderr, "failed to send()!\n"); + fprintf(stderr, "failed to send().\n"); goto shutdown; } wr += nsent; } if(libssh2_channel_eof(channel)) { - fprintf(stderr, "The server at %s:%d disconnected!\n", + fprintf(stderr, "The server at %s:%d disconnected.\n", remote_desthost, remote_destport); goto shutdown; } diff --git a/example/scp.c b/example/scp.c index ab4ad5f3..ac249c1e 100644 --- a/example/scp.c +++ b/example/scp.c @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -88,14 +88,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -123,7 +123,7 @@ int main(int argc, char *argv[]) if(auth_pw) { /* We could authenticate via password */ if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } diff --git a/example/scp_nonblock.c b/example/scp_nonblock.c index a8f95cb1..745e744f 100644 --- a/example/scp_nonblock.c +++ b/example/scp_nonblock.c @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -142,14 +142,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -187,7 +187,7 @@ int main(int argc, char *argv[]) while((rc = libssh2_userauth_password(session, username, password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) #endif /* Request a file via SCP */ - fprintf(stderr, "libssh2_scp_recv2()!\n"); + fprintf(stderr, "libssh2_scp_recv2().\n"); do { channel = libssh2_scp_recv2(session, scppath, &fileinfo); @@ -226,7 +226,7 @@ int main(int argc, char *argv[]) } } } while(!channel); - fprintf(stderr, "libssh2_scp_recv() is done, now receive data!\n"); + fprintf(stderr, "libssh2_scp_recv() is done, now receive data.\n"); while(got < fileinfo.st_size) { char mem[1024 * 24]; diff --git a/example/scp_write.c b/example/scp_write.c index e56df3c1..effb7a61 100644 --- a/example/scp_write.c +++ b/example/scp_write.c @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -99,14 +99,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) if(auth_pw) { /* We could authenticate via password */ if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } diff --git a/example/scp_write_nonblock.c b/example/scp_write_nonblock.c index dc87dbf5..bbc03178 100644 --- a/example/scp_write_nonblock.c +++ b/example/scp_write_nonblock.c @@ -126,7 +126,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -134,14 +134,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) while((rc = libssh2_userauth_password(session, username, password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } diff --git a/example/sftp.c b/example/sftp.c index 4568b2a8..ea813f0c 100644 --- a/example/sftp.c +++ b/example/sftp.c @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -144,14 +144,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -210,7 +210,7 @@ int main(int argc, char *argv[]) if(auth_pw & 1) { /* We could authenticate via password */ if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_keyboard_interactive(session, username, &kbd_callback) ) { fprintf(stderr, - "Authentication by keyboard-interactive failed!\n"); + "Authentication by keyboard-interactive failed.\n"); goto shutdown; } else { @@ -232,7 +232,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } else { @@ -240,12 +240,12 @@ int main(int argc, char *argv[]) } } else { - fprintf(stderr, "No supported authentication methods found!\n"); + fprintf(stderr, "No supported authentication methods found.\n"); goto shutdown; } } - fprintf(stderr, "libssh2_sftp_init()!\n"); + fprintf(stderr, "libssh2_sftp_init().\n"); sftp_session = libssh2_sftp_init(session); if(!sftp_session) { @@ -253,7 +253,7 @@ int main(int argc, char *argv[]) goto shutdown; } - fprintf(stderr, "libssh2_sftp_open()!\n"); + fprintf(stderr, "libssh2_sftp_open().\n"); /* Request a file via SFTP */ sftp_handle = libssh2_sftp_open(sftp_session, sftppath, LIBSSH2_FXF_READ, 0); @@ -263,13 +263,13 @@ int main(int argc, char *argv[]) goto shutdown; } - fprintf(stderr, "libssh2_sftp_open() is done, now receive data!\n"); + fprintf(stderr, "libssh2_sftp_open() is done, now receive data.\n"); do { char mem[1024]; ssize_t nread; /* loop until we fail */ - fprintf(stderr, "libssh2_sftp_read()!\n"); + fprintf(stderr, "libssh2_sftp_read().\n"); nread = libssh2_sftp_read(sftp_handle, mem, sizeof(mem)); if(nread > 0) { write(1, mem, nread); diff --git a/example/sftp_RW_nonblock.c b/example/sftp_RW_nonblock.c index b7e8b238..3f5b7373 100644 --- a/example/sftp_RW_nonblock.c +++ b/example/sftp_RW_nonblock.c @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -124,14 +124,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = htonl(0x7F000001); if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -169,7 +169,7 @@ int main(int argc, char *argv[]) while((rc = libssh2_userauth_password(session, username, password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -181,7 +181,7 @@ int main(int argc, char *argv[]) password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } @@ -218,7 +218,7 @@ int main(int argc, char *argv[]) } } while(!sftp_handle); - fprintf(stderr, "libssh2_sftp_open() is done, now receive data!\n"); + fprintf(stderr, "libssh2_sftp_open() is done, now receive data.\n"); do { ssize_t nread; do { @@ -321,7 +321,7 @@ int main(int argc, char *argv[]) break; } } while(1); - fprintf(stderr, "SFTP upload done!\n"); + fprintf(stderr, "SFTP upload done.\n"); } else { fprintf(stderr, "SFTP failed to open destination path: %s\n", diff --git a/example/sftp_append.c b/example/sftp_append.c index e3de2ae9..c2296d0b 100644 --- a/example/sftp_append.c +++ b/example/sftp_append.c @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -106,14 +106,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -144,7 +144,7 @@ int main(int argc, char *argv[]) if(auth_pw) { /* We could authenticate via password */ if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -153,12 +153,12 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } - fprintf(stderr, "libssh2_sftp_init()!\n"); + fprintf(stderr, "libssh2_sftp_init().\n"); sftp_session = libssh2_sftp_init(session); if(!sftp_session) { @@ -166,7 +166,7 @@ int main(int argc, char *argv[]) goto shutdown; } - fprintf(stderr, "libssh2_sftp_open() for READ and WRITE!\n"); + fprintf(stderr, "libssh2_sftp_open() for READ and WRITE.\n"); /* Request a file via SFTP */ sftp_handle = libssh2_sftp_open(sftp_session, sftppath, LIBSSH2_FXF_WRITE | @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) goto shutdown; } - fprintf(stderr, "libssh2_sftp_open() is done, now send data!\n"); + fprintf(stderr, "libssh2_sftp_open() is done, now send data.\n"); do { nread = fread(mem, 1, sizeof(mem), local); if(nread <= 0) { diff --git a/example/sftp_mkdir.c b/example/sftp_mkdir.c index 4a714680..6f387ad1 100644 --- a/example/sftp_mkdir.c +++ b/example/sftp_mkdir.c @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -89,14 +89,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) if(auth_pw) { /* We could authenticate via password */ if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } diff --git a/example/sftp_mkdir_nonblock.c b/example/sftp_mkdir_nonblock.c index fabc0780..351e132c 100644 --- a/example/sftp_mkdir_nonblock.c +++ b/example/sftp_mkdir_nonblock.c @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -89,14 +89,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) if(auth_pw) { /* We could authenticate via password */ if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } diff --git a/example/sftp_nonblock.c b/example/sftp_nonblock.c index 6ac5290e..f93897ca 100644 --- a/example/sftp_nonblock.c +++ b/example/sftp_nonblock.c @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -143,14 +143,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -188,7 +188,7 @@ int main(int argc, char *argv[]) while((rc = libssh2_userauth_password(session, username, password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -200,14 +200,14 @@ int main(int argc, char *argv[]) password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } #if 0 libssh2_trace(session, LIBSSH2_TRACE_CONN); #endif - fprintf(stderr, "libssh2_sftp_init()!\n"); + fprintf(stderr, "libssh2_sftp_init().\n"); do { sftp_session = libssh2_sftp_init(session); @@ -223,7 +223,7 @@ int main(int argc, char *argv[]) } } while(!sftp_session); - fprintf(stderr, "libssh2_sftp_open()!\n"); + fprintf(stderr, "libssh2_sftp_open().\n"); /* Request a file via SFTP */ do { sftp_handle = libssh2_sftp_open(sftp_session, sftppath, @@ -241,7 +241,7 @@ int main(int argc, char *argv[]) } } while(!sftp_handle); - fprintf(stderr, "libssh2_sftp_open() is done, now receive data!\n"); + fprintf(stderr, "libssh2_sftp_open() is done, now receive data.\n"); do { char mem[1024 * 24]; ssize_t nread; diff --git a/example/sftp_write.c b/example/sftp_write.c index c7e84fef..1394fd3b 100644 --- a/example/sftp_write.c +++ b/example/sftp_write.c @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -105,14 +105,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) if(auth_pw) { /* We could authenticate via password */ if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -152,12 +152,12 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } - fprintf(stderr, "libssh2_sftp_init()!\n"); + fprintf(stderr, "libssh2_sftp_init().\n"); sftp_session = libssh2_sftp_init(session); if(!sftp_session) { @@ -165,7 +165,7 @@ int main(int argc, char *argv[]) goto shutdown; } - fprintf(stderr, "libssh2_sftp_open()!\n"); + fprintf(stderr, "libssh2_sftp_open().\n"); /* Request a file via SFTP */ sftp_handle = libssh2_sftp_open(sftp_session, sftppath, LIBSSH2_FXF_WRITE | @@ -181,7 +181,7 @@ int main(int argc, char *argv[]) goto shutdown; } - fprintf(stderr, "libssh2_sftp_open() is done, now send data!\n"); + fprintf(stderr, "libssh2_sftp_open() is done, now send data.\n"); do { nread = fread(mem, 1, sizeof(mem), local); if(nread <= 0) { diff --git a/example/sftp_write_nonblock.c b/example/sftp_write_nonblock.c index 42d3ee43..b0b1ce9d 100644 --- a/example/sftp_write_nonblock.c +++ b/example/sftp_write_nonblock.c @@ -131,7 +131,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -139,14 +139,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) while((rc = libssh2_userauth_password(session, username, password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -191,12 +191,12 @@ int main(int argc, char *argv[]) password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } - fprintf(stderr, "libssh2_sftp_init()!\n"); + fprintf(stderr, "libssh2_sftp_init().\n"); do { sftp_session = libssh2_sftp_init(session); @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) } } while(!sftp_session); - fprintf(stderr, "libssh2_sftp_open()!\n"); + fprintf(stderr, "libssh2_sftp_open().\n"); /* Request a file via SFTP */ do { sftp_handle = libssh2_sftp_open(sftp_session, sftppath, @@ -226,7 +226,7 @@ int main(int argc, char *argv[]) } } while(!sftp_handle); - fprintf(stderr, "libssh2_sftp_open() is done, now send data!\n"); + fprintf(stderr, "libssh2_sftp_open() is done, now send data.\n"); start = time(NULL); do { nread = fread(mem, 1, sizeof(mem), local); diff --git a/example/sftp_write_sliding.c b/example/sftp_write_sliding.c index 9dee8ddd..7fa32494 100644 --- a/example/sftp_write_sliding.c +++ b/example/sftp_write_sliding.c @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -140,14 +140,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -181,7 +181,7 @@ int main(int argc, char *argv[]) while((rc = libssh2_userauth_password(session, username, password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -192,12 +192,12 @@ int main(int argc, char *argv[]) password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } - fprintf(stderr, "libssh2_sftp_init()!\n"); + fprintf(stderr, "libssh2_sftp_init().\n"); do { sftp_session = libssh2_sftp_init(session); @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) } } while(!sftp_session); - fprintf(stderr, "libssh2_sftp_open()!\n"); + fprintf(stderr, "libssh2_sftp_open().\n"); /* Request a file via SFTP */ do { sftp_handle = libssh2_sftp_open(sftp_session, sftppath, @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) } } while(!sftp_handle); - fprintf(stderr, "libssh2_sftp_open() is done, now send data!\n"); + fprintf(stderr, "libssh2_sftp_open() is done, now send data.\n"); start = time(NULL); memuse = 0; /* it starts blank */ do { diff --git a/example/sftpdir.c b/example/sftpdir.c index 487f2204..b790131b 100644 --- a/example/sftpdir.c +++ b/example/sftpdir.c @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -117,14 +117,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) if(auth_pw & 1) { /* We could authenticate via password */ if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -189,7 +189,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_keyboard_interactive(session, username, &kbd_callback) ) { fprintf(stderr, - "Authentication by keyboard-interactive failed!\n"); + "Authentication by keyboard-interactive failed.\n"); goto shutdown; } else { @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } else { @@ -210,12 +210,12 @@ int main(int argc, char *argv[]) } } else { - fprintf(stderr, "No supported authentication methods found!\n"); + fprintf(stderr, "No supported authentication methods found.\n"); goto shutdown; } } - fprintf(stderr, "libssh2_sftp_init()!\n"); + fprintf(stderr, "libssh2_sftp_init().\n"); sftp_session = libssh2_sftp_init(session); if(!sftp_session) { @@ -226,7 +226,7 @@ int main(int argc, char *argv[]) /* Since we have not set non-blocking, tell libssh2 we are blocking */ libssh2_session_set_blocking(session, 1); - fprintf(stderr, "libssh2_sftp_opendir()!\n"); + fprintf(stderr, "libssh2_sftp_opendir().\n"); /* Request a dir listing via SFTP */ sftp_handle = libssh2_sftp_opendir(sftp_session, sftppath); if(!sftp_handle) { @@ -234,7 +234,7 @@ int main(int argc, char *argv[]) goto shutdown; } - fprintf(stderr, "libssh2_sftp_opendir() is done, now receive listing!\n"); + fprintf(stderr, "libssh2_sftp_opendir() is done, now receive listing.\n"); do { char mem[512]; char longentry[512]; diff --git a/example/sftpdir_nonblock.c b/example/sftpdir_nonblock.c index 3cd38184..8c61106c 100644 --- a/example/sftpdir_nonblock.c +++ b/example/sftpdir_nonblock.c @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -96,14 +96,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -137,7 +137,7 @@ int main(int argc, char *argv[]) while((rc = libssh2_userauth_password(session, username, password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -148,12 +148,12 @@ int main(int argc, char *argv[]) password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } - fprintf(stderr, "libssh2_sftp_init()!\n"); + fprintf(stderr, "libssh2_sftp_init().\n"); do { sftp_session = libssh2_sftp_init(session); @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) } } while(!sftp_session); - fprintf(stderr, "libssh2_sftp_opendir()!\n"); + fprintf(stderr, "libssh2_sftp_opendir().\n"); /* Request a dir listing via SFTP */ do { sftp_handle = libssh2_sftp_opendir(sftp_session, sftppath); @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) } } while(!sftp_handle); - fprintf(stderr, "libssh2_sftp_opendir() is done, now receive listing!\n"); + fprintf(stderr, "libssh2_sftp_opendir() is done, now receive listing.\n"); do { char mem[512]; LIBSSH2_SFTP_ATTRIBUTES attrs; diff --git a/example/ssh2.c b/example/ssh2.c index 11b34c7e..7b210121 100644 --- a/example/ssh2.c +++ b/example/ssh2.c @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); rc = 1; goto shutdown; } @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), username); if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) if(auth_pw & 1) { /* We could authenticate via password */ if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } else { @@ -194,7 +194,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_keyboard_interactive(session, username, &kbd_callback) ) { fprintf(stderr, - "Authentication by keyboard-interactive failed!\n"); + "Authentication by keyboard-interactive failed.\n"); goto shutdown; } else { @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, fn1, fn2, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); free(fn2); free(fn1); goto shutdown; @@ -239,7 +239,7 @@ int main(int argc, char *argv[]) free(fn1); } else { - fprintf(stderr, "No supported authentication methods found!\n"); + fprintf(stderr, "No supported authentication methods found.\n"); goto shutdown; } } diff --git a/example/ssh2_agent.c b/example/ssh2_agent.c index aacabd44..cef951d6 100644 --- a/example/ssh2_agent.c +++ b/example/ssh2_agent.c @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); rc = 1; goto shutdown; } @@ -81,14 +81,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) if(userauthlist) { fprintf(stderr, "Authentication methods: %s\n", userauthlist); if(!strstr(userauthlist, "publickey")) { - fprintf(stderr, "\"publickey\" authentication is not supported\n"); + fprintf(stderr, "'publickey' authentication is not supported\n"); goto shutdown; } @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) } if(libssh2_agent_userauth(agent, username, identity)) { fprintf(stderr, "Authentication with username %s and " - "public key %s failed!\n", + "public key %s failed.\n", username, identity->comment); } else { diff --git a/example/ssh2_agent_forwarding.c b/example/ssh2_agent_forwarding.c index 584f4318..8d727441 100644 --- a/example/ssh2_agent_forwarding.c +++ b/example/ssh2_agent_forwarding.c @@ -113,7 +113,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -121,14 +121,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -166,7 +166,7 @@ int main(int argc, char *argv[]) } if(libssh2_agent_userauth(agent, username, identity)) { fprintf(stderr, "Authentication with username %s and " - "public key %s failed!\n", + "public key %s failed.\n", username, identity->comment); } else { @@ -212,7 +212,7 @@ int main(int argc, char *argv[]) exit(1); } else { - fprintf(stdout, "Agent forwarding request succeeded!\n"); + fprintf(stdout, "Agent forwarding request succeeded.\n"); } while((rc = libssh2_channel_exec(channel, commandline)) == LIBSSH2_ERROR_EAGAIN) { diff --git a/example/ssh2_echo.c b/example/ssh2_echo.c index c254c0ce..58616133 100644 --- a/example/ssh2_echo.c +++ b/example/ssh2_echo.c @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -119,14 +119,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) while((rc = libssh2_userauth_password(session, username, password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); exit(1); } } diff --git a/example/ssh2_exec.c b/example/ssh2_exec.c index 7f559b2a..27d1829d 100644 --- a/example/ssh2_exec.c +++ b/example/ssh2_exec.c @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) */ sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -125,14 +125,14 @@ int main(int argc, char *argv[]) sin.sin_port = htons(22); sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "failed to connect!\n"); + fprintf(stderr, "failed to connect.\n"); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) while((rc = libssh2_userauth_password(session, username, password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) password)) == LIBSSH2_ERROR_EAGAIN); if(rc) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } } diff --git a/example/subsystem_netconf.c b/example/subsystem_netconf.c index b40aa8e0..6dd82a79 100644 --- a/example/subsystem_netconf.c +++ b/example/subsystem_netconf.c @@ -73,7 +73,7 @@ static ssize_t netconf_read_until(LIBSSH2_CHANNEL *channel, const char *endtag, /* read more data until we see a rpc-reply closing tag followed by * the special sequence ]]>]]> */ - /* really, this MUST be replaced with proper XML parsing! */ + /* really, this MUST be replaced with proper XML parsing. */ endreply = strstr(buf, endtag); if(endreply) @@ -82,8 +82,8 @@ static ssize_t netconf_read_until(LIBSSH2_CHANNEL *channel, const char *endtag, } while(!specialsequence && rd < buflen); if(!specialsequence) { - fprintf(stderr, "netconf_read_until(): ]]>]]> not found!" - " read buffer too small?\n"); + fprintf(stderr, "netconf_read_until(): ]]>]]> not found." + " Read buffer too small?\n"); return -1; } @@ -133,26 +133,26 @@ int main(int argc, char *argv[]) /* Connect to SSH server */ sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to open socket!\n"); + fprintf(stderr, "failed to open socket.\n"); goto shutdown; } sin.sin_family = AF_INET; sin.sin_addr.s_addr = inet_addr(server_ip); if(INADDR_NONE == sin.sin_addr.s_addr) { - fprintf(stderr, "inet_addr: Invalid IP address \"%s\"\n", server_ip); + fprintf(stderr, "inet_addr: Invalid IP address '%s'\n", server_ip); goto shutdown; } sin.sin_port = htons(830); if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "Failed to connect to %s!\n", inet_ntoa(sin.sin_addr)); + fprintf(stderr, "Failed to connect to %s.\n", inet_ntoa(sin.sin_addr)); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) if(auth & AUTH_PASSWORD) { if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -204,7 +204,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } else { @@ -212,7 +212,7 @@ int main(int argc, char *argv[]) } } else { - fprintf(stderr, "No supported authentication methods found!\n"); + fprintf(stderr, "No supported authentication methods found.\n"); goto shutdown; } } @@ -220,16 +220,16 @@ int main(int argc, char *argv[]) /* open a channel */ channel = libssh2_channel_open_session(session); if(!channel) { - fprintf(stderr, "Could not open the channel!\n" - "(Note that this can be a problem at the server!" - " Please review the server logs.)\n"); + fprintf(stderr, "Could not open the channel.\n" + "(Note that this can be a problem at the server." + " Please review the server logs.)\n"); goto shutdown; } /* execute the subsystem on our channel */ if(libssh2_channel_subsystem(channel, "netconf")) { - fprintf(stderr, "Could not execute the \"netconf\" subsystem!\n" - "(Note that this can be a problem at the server!" + fprintf(stderr, "Could not execute the 'netconf' subsystem.\n" + "(Note that this can be a problem at the server." " Please review the server logs.)\n"); goto shutdown; } diff --git a/example/tcpip-forward.c b/example/tcpip-forward.c index 2b99f95c..28e83e3a 100644 --- a/example/tcpip-forward.c +++ b/example/tcpip-forward.c @@ -102,26 +102,26 @@ int main(int argc, char *argv[]) /* Connect to SSH server */ sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to open socket!\n"); + fprintf(stderr, "failed to open socket.\n"); goto shutdown; } sin.sin_family = AF_INET; sin.sin_addr.s_addr = inet_addr(server_ip); if(INADDR_NONE == sin.sin_addr.s_addr) { - fprintf(stderr, "inet_addr: Invalid IP address \"%s\"\n", server_ip); + fprintf(stderr, "inet_addr: Invalid IP address '%s'\n", server_ip); goto shutdown; } sin.sin_port = htons(22); if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "Failed to connect to %s!\n", inet_ntoa(sin.sin_addr)); + fprintf(stderr, "Failed to connect to %s.\n", inet_ntoa(sin.sin_addr)); goto shutdown; } /* Create a session instance */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -165,7 +165,7 @@ int main(int argc, char *argv[]) if(auth & AUTH_PASSWORD) { if(libssh2_userauth_password(session, username, password)) { - fprintf(stderr, "Authentication by password failed!\n"); + fprintf(stderr, "Authentication by password failed.\n"); goto shutdown; } } @@ -173,7 +173,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } else { @@ -181,7 +181,7 @@ int main(int argc, char *argv[]) } } else { - fprintf(stderr, "No supported authentication methods found!\n"); + fprintf(stderr, "No supported authentication methods found.\n"); goto shutdown; } } @@ -192,8 +192,8 @@ int main(int argc, char *argv[]) listener = libssh2_channel_forward_listen_ex(session, remote_listenhost, remote_wantport, &remote_listenport, 1); if(!listener) { - fprintf(stderr, "Could not start the tcpip-forward listener!\n" - "(Note that this can be a problem at the server!" + fprintf(stderr, "Could not start the tcpip-forward listener.\n" + "(Note that this can be a problem at the server." " Please review the server logs.)\n"); goto shutdown; } @@ -204,8 +204,8 @@ int main(int argc, char *argv[]) fprintf(stderr, "Waiting for remote connection\n"); channel = libssh2_channel_forward_accept(listener); if(!channel) { - fprintf(stderr, "Could not accept connection!\n" - "(Note that this can be a problem at the server!" + fprintf(stderr, "Could not accept connection.\n" + "(Note that this can be a problem at the server." " Please review the server logs.)\n"); goto shutdown; } @@ -215,7 +215,7 @@ int main(int argc, char *argv[]) local_destip, local_destport); forwardsock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if(forwardsock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to open forward socket!\n"); + fprintf(stderr, "failed to open forward socket.\n"); goto shutdown; } @@ -223,11 +223,11 @@ int main(int argc, char *argv[]) sin.sin_port = htons((unsigned short)local_destport); sin.sin_addr.s_addr = inet_addr(local_destip); if(INADDR_NONE == sin.sin_addr.s_addr) { - fprintf(stderr, "failed in inet_addr()!\n"); + fprintf(stderr, "failed in inet_addr().\n"); goto shutdown; } if(-1 == connect(forwardsock, (struct sockaddr *)&sin, sinlen)) { - fprintf(stderr, "failed to connect()!\n"); + fprintf(stderr, "failed to connect().\n"); goto shutdown; } @@ -244,18 +244,18 @@ int main(int argc, char *argv[]) tv.tv_usec = 100000; rc = select((int)(forwardsock + 1), &fds, NULL, NULL, &tv); if(-1 == rc) { - fprintf(stderr, "failed to select()!\n"); + fprintf(stderr, "failed to select().\n"); goto shutdown; } if(rc && FD_ISSET(forwardsock, &fds)) { ssize_t nwritten; len = recv(forwardsock, buf, sizeof(buf), 0); if(len < 0) { - fprintf(stderr, "failed to recv()!\n"); + fprintf(stderr, "failed to recv().\n"); goto shutdown; } else if(len == 0) { - fprintf(stderr, "The local server at %s:%d disconnected!\n", + fprintf(stderr, "The local server at %s:%d disconnected.\n", local_destip, local_destport); goto shutdown; } @@ -284,13 +284,13 @@ int main(int argc, char *argv[]) while(wr < len) { nsent = send(forwardsock, buf + wr, len - wr, 0); if(nsent <= 0) { - fprintf(stderr, "failed to send()!\n"); + fprintf(stderr, "failed to send().\n"); goto shutdown; } wr += nsent; } if(libssh2_channel_eof(channel)) { - fprintf(stderr, "The remote client at %s:%d disconnected!\n", + fprintf(stderr, "The remote client at %s:%d disconnected.\n", remote_listenhost, remote_listenport); goto shutdown; } diff --git a/example/x11.c b/example/x11.c index 8be003fb..631951cd 100644 --- a/example/x11.c +++ b/example/x11.c @@ -141,7 +141,7 @@ static void x11_callback(LIBSSH2_SESSION *session, LIBSSH2_CHANNEL *channel, ptr = strrchr(display, ':'); temp_buff = (char *)calloc(strlen(ptr + 1) + 1, sizeof(char)); if(!temp_buff) { - fprintf(stderr, "failed to calloc()!\n"); + fprintf(stderr, "failed to calloc().\n"); return; } memcpy(temp_buff, ptr + 1, strlen(ptr + 1)); @@ -311,7 +311,7 @@ int main(int argc, char *argv[]) sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to open socket!\n"); + fprintf(stderr, "failed to open socket.\n"); return -1; } @@ -320,7 +320,7 @@ int main(int argc, char *argv[]) sin.sin_addr.s_addr = hostaddr; if(connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in))) { - fprintf(stderr, "Failed to established connection!\n"); + fprintf(stderr, "Failed to established connection.\n"); return -1; } /* Open a session */ diff --git a/src/channel.c b/src/channel.c index 2091d60d..9a3c84a0 100644 --- a/src/channel.c +++ b/src/channel.c @@ -2617,7 +2617,7 @@ static int channel_wait_eof(LIBSSH2_CHANNEL *channel) else if(rc < 0) { channel->wait_eof_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, - "_libssh2_transport_read() bailed out!"); + "_libssh2_transport_read() bailed out"); } } while(1); diff --git a/src/kex.c b/src/kex.c index d4034a0a..1a3ac8a2 100644 --- a/src/kex.c +++ b/src/kex.c @@ -4165,7 +4165,7 @@ LIBSSH2_API int libssh2_session_supported_algs(LIBSSH2_SESSION* session, return _libssh2_error(session, LIBSSH2_ERROR_ALLOC, "Memory allocation failed"); } - /* Past this point *algs must be deallocated in case of an error!! */ + /* Past this point *algs must be deallocated in case of an error! */ /* copy non-NULL pointers only */ for(i = 0, j = 0; mlist[i] && j < ialg; i++) { diff --git a/src/sftp.c b/src/sftp.c index 46164ea3..2bb4bdd0 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -1271,7 +1271,7 @@ sftp_open(LIBSSH2_SFTP *sftp, const char *filename, if(LIBSSH2_FX_OK == sftp->last_errno) { _libssh2_debug((session, LIBSSH2_TRACE_SFTP, - "got HANDLE FXOK!")); + "got HANDLE FXOK")); LIBSSH2_FREE(session, data); @@ -3379,7 +3379,7 @@ static int sftp_mkdir(LIBSSH2_SFTP *sftp, const char *path, LIBSSH2_FREE(session, data); if(retcode == LIBSSH2_FX_OK) { - _libssh2_debug((session, LIBSSH2_TRACE_SFTP, "OK!")); + _libssh2_debug((session, LIBSSH2_TRACE_SFTP, "OK")); return 0; } else { diff --git a/src/transport.c b/src/transport.c index 6d902d33..f86f1c0b 100644 --- a/src/transport.c +++ b/src/transport.c @@ -887,7 +887,7 @@ int _libssh2_transport_send(LIBSSH2_SESSION *session, debugdump(session, "libssh2_transport_write plain2", data2, data2_len); /* FIRST, check if we have a pending write to complete. send_existing - only sanity-check data and data_len and not data2 and data2_len!! */ + only sanity-check data and data_len and not data2 and data2_len! */ rc = send_existing(session, data, data_len, &ret); if(rc) return rc; diff --git a/tests/ossfuzz/standaloneengine.cc b/tests/ossfuzz/standaloneengine.cc index 175360e4..95517eb2 100644 --- a/tests/ossfuzz/standaloneengine.cc +++ b/tests/ossfuzz/standaloneengine.cc @@ -45,7 +45,7 @@ int main(int argc, char **argv) /* Call the fuzzer with the data. */ LLVMFuzzerTestOneInput(buffer, buffer_len); - printf("complete !!"); + printf("complete."); /* Free the buffer as it's no longer needed. */ free(buffer); diff --git a/tests/runner.c b/tests/runner.c index 343161d1..573f7241 100644 --- a/tests/runner.c +++ b/tests/runner.c @@ -69,7 +69,7 @@ int main(void) ++retry > retries) { break; } - fprintf(stderr, "Test failed (%d)! Retrying... %d / %d\n", + fprintf(stderr, "Test failed (%d). Retrying... %d / %d\n", rc, retry, retries); } while(1); diff --git a/tests/test_ssh2.c b/tests/test_ssh2.c index a637cdc9..88b4704d 100644 --- a/tests/test_ssh2.c +++ b/tests/test_ssh2.c @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) sock = socket(AF_INET, SOCK_STREAM, 0); if(sock == LIBSSH2_INVALID_SOCKET) { - fprintf(stderr, "failed to create socket!\n"); + fprintf(stderr, "failed to create socket.\n"); goto shutdown; } @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) */ session = libssh2_session_init(); if(!session) { - fprintf(stderr, "Could not initialize SSH session!\n"); + fprintf(stderr, "Could not initialize SSH session.\n"); goto shutdown; } @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) if(libssh2_userauth_publickey_fromfile(session, username, pubkey, privkey, password)) { - fprintf(stderr, "Authentication by public key failed!\n"); + fprintf(stderr, "Authentication by public key failed.\n"); goto shutdown; } else { @@ -199,7 +199,7 @@ int main(int argc, char *argv[]) } } else { - fprintf(stderr, "No supported authentication methods found!\n"); + fprintf(stderr, "No supported authentication methods found.\n"); goto shutdown; } }