Commit 5e7a48fd authored by Antenore Gatta's avatar Antenore Gatta

Applying codying style guide

parent adf19655
......@@ -226,7 +226,7 @@ remmina_ssh_auth_pubkey(RemminaSSH *ssh)
}
if ( ssh_pki_import_privkey_file( ssh->privkeyfile, (ssh->passphrase ? ssh->passphrase : ""),
NULL, NULL, &priv_key ) != SSH_OK ) {
NULL, NULL, &priv_key ) != SSH_OK ) {
if (ssh->passphrase == NULL || ssh->passphrase[0] == '\0') return -1;
remmina_ssh_set_error(ssh, _("SSH public key authentication failed: %s"));
......@@ -404,10 +404,10 @@ remmina_ssh_auth_gui(RemminaSSH *ssh, RemminaProtocolWidget *gp, RemminaFile *re
_("The server is unknown. The public key fingerprint is:"),
keyname,
_("Do you trust the new public key?"));
}else {
}else {
message = g_strdup_printf("%s\n%s\n\n%s",
_("WARNING: The server has changed its public key. This means either you are under attack,\n"
"or the administrator has changed the key. The new public key fingerprint is:"),
"or the administrator has changed the key. The new public key fingerprint is:"),
keyname,
_("Do you trust the new public key?"));
}
......@@ -470,7 +470,7 @@ remmina_ssh_auth_gui(RemminaSSH *ssh, RemminaProtocolWidget *gp, RemminaFile *re
remmina_file_set_string(remminafile, pwdtype, pwd);
g_free(pwd);
}
}else {
}else {
return -1;
}
pwd = remmina_protocol_widget_get_password(gp);
......@@ -668,7 +668,7 @@ remmina_ssh_init_from_file(RemminaSSH *ssh, RemminaFile *remminafile)
}else if (server == NULL) {
ssh->server = g_strdup("localhost");
ssh->port = 22;
}else {
}else {
remmina_public_get_server_port(server, 0, &ssh->server, NULL);
ssh->port = 22;
}
......@@ -690,7 +690,7 @@ remmina_ssh_init_from_file(RemminaSSH *ssh, RemminaFile *remminafile)
if (s) {
ssh->privkeyfile = remmina_ssh_identity_path(s);
g_free(s);
}else {
}else {
ssh->privkeyfile = NULL;
}
......@@ -922,7 +922,7 @@ remmina_ssh_tunnel_accept_local_connection(RemminaSSHTunnel *tunnel, gboolean bl
sock_flags = fcntl(tunnel->server_sock, F_GETFL, 0);
if (blocking) {
sock_flags &= ~O_NONBLOCK;
}else {
}else {
sock_flags |= O_NONBLOCK;
}
fcntl(tunnel->server_sock, F_SETFL, sock_flags);
......@@ -986,8 +986,8 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data)
case REMMINA_SSH_TUNNEL_OPEN:
sock = remmina_ssh_tunnel_accept_local_connection(tunnel, TRUE);
if (sock < 0) {
tunnel->thread = 0;
return NULL;
tunnel->thread = 0;
return NULL;
}
channel = remmina_ssh_tunnel_create_forward_channel(tunnel);
......@@ -1043,17 +1043,17 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data)
case REMMINA_SSH_TUNNEL_XPORT:
/* Detect the next available port starting from 6010 on the server */
for (i = 10; i <= MAX_X_DISPLAY_NUMBER; i++) {
#if LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 7, 0)
#if LIBSSH_VERSION_INT >= SSH_VERSION_INT(0, 7, 0)
if (ssh_channel_listen_forward(REMMINA_SSH(tunnel)->session, (tunnel->bindlocalhost ? "localhost" : NULL), 6000 + i, NULL)) {
continue;
}else {
}else {
tunnel->remotedisplay = i;
break;
}
#else
if (ssh_forward_listen(REMMINA_SSH(tunnel)->session, (tunnel->bindlocalhost ? "localhost" : NULL), 6000 + i, NULL)) {
continue;
}else {
}else {
tunnel->remotedisplay = i;
break;
}
......@@ -1080,9 +1080,9 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data)
break;
case REMMINA_SSH_TUNNEL_REVERSE:
#if LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 7, 0)
#if LIBSSH_VERSION_INT >= SSH_VERSION_INT(0, 7, 0)
if (ssh_channel_listen_forward(REMMINA_SSH(tunnel)->session, NULL, tunnel->port, NULL)) {
remmina_ssh_set_error(REMMINA_SSH (tunnel), _("Failed to request port forwarding: %s"));
remmina_ssh_set_error(REMMINA_SSH(tunnel), _("Failed to request port forwarding: %s"));
if (tunnel->disconnect_func) {
(*tunnel->disconnect_func)(tunnel, tunnel->callback_data);
}
......@@ -1091,7 +1091,7 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data)
}
#else
if (ssh_forward_listen(REMMINA_SSH(tunnel)->session, NULL, tunnel->port, NULL)) {
remmina_ssh_set_error(REMMINA_SSH (tunnel), _("Failed to request port forwarding: %s"));
remmina_ssh_set_error(REMMINA_SSH(tunnel), _("Failed to request port forwarding: %s"));
if (tunnel->disconnect_func) {
(*tunnel->disconnect_func)(tunnel, tunnel->callback_data);
}
......@@ -1125,7 +1125,7 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data)
/* Wait for a period of time for the first incoming connection */
if (tunnel->tunnel_type == REMMINA_SSH_TUNNEL_X11) {
channel = ssh_channel_accept_x11(tunnel->x11_channel, 15000);
}else {
}else {
channel = ssh_channel_accept_forward(REMMINA_SSH(tunnel)->session, 15000, &tunnel->port);
}
if (!channel) {
......@@ -1141,10 +1141,10 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data)
}
if (tunnel->tunnel_type == REMMINA_SSH_TUNNEL_REVERSE) {
/* For reverse tunnel, we only need one connection. */
#if LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 7, 0)
ssh_channel_cancel_forward(REMMINA_SSH (tunnel)->session, NULL, tunnel->port);
#if LIBSSH_VERSION_INT >= SSH_VERSION_INT(0, 7, 0)
ssh_channel_cancel_forward(REMMINA_SSH(tunnel)->session, NULL, tunnel->port);
#else
ssh_forward_cancel(REMMINA_SSH (tunnel)->session, NULL, tunnel->port);
ssh_forward_cancel(REMMINA_SSH(tunnel)->session, NULL, tunnel->port);
#endif
}
}else if (tunnel->tunnel_type != REMMINA_SSH_TUNNEL_REVERSE) {
......@@ -1155,7 +1155,7 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data)
if (diff > 1) {
if (tunnel->tunnel_type == REMMINA_SSH_TUNNEL_X11) {
channel = ssh_channel_accept_x11(tunnel->x11_channel, 0);
}else {
}else {
channel = ssh_channel_accept_forward(REMMINA_SSH(tunnel)->session, 0, &tunnel->port);
}
if (channel == NULL) {
......@@ -1176,12 +1176,12 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data)
close(sock);
sock = -1;
}
}else {
}else {
sock = remmina_public_open_xdisplay(tunnel->localdisplay);
}
if (sock >= 0) {
remmina_ssh_tunnel_add_channel(tunnel, channel, sock);
}else {
}else {
/* Failed to create unix socket. Will this happen? */
ssh_channel_close(channel);
ssh_channel_send_eof(channel);
......@@ -1256,7 +1256,7 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data)
if (len <= 0) {
remmina_ssh_set_error(REMMINA_SSH(tunnel), _("ssh_channel_read_nonblocking() returned an error: %s"));
disconnected = TRUE;
}else {
}else {
tunnel->socketbuffers[i]->len = len;
}
}
......@@ -1303,7 +1303,7 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data)
close(sock);
/* Leave thread loop */
tunnel->running = FALSE;
}else {
}else {
remmina_ssh_tunnel_add_channel(tunnel, channel, sock);
}
}
......@@ -1462,10 +1462,10 @@ remmina_ssh_tunnel_free(RemminaSSHTunnel* tunnel)
}
if (tunnel->tunnel_type == REMMINA_SSH_TUNNEL_XPORT && tunnel->remotedisplay > 0) {
#if LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 7, 0)
ssh_channel_cancel_forward(REMMINA_SSH (tunnel)->session, NULL, 6000 + tunnel->remotedisplay);
#if LIBSSH_VERSION_INT >= SSH_VERSION_INT(0, 7, 0)
ssh_channel_cancel_forward(REMMINA_SSH(tunnel)->session, NULL, 6000 + tunnel->remotedisplay);
#else
ssh_forward_cancel(REMMINA_SSH (tunnel)->session, NULL, 6000 + tunnel->remotedisplay);
ssh_forward_cancel(REMMINA_SSH(tunnel)->session, NULL, 6000 + tunnel->remotedisplay);
#endif
}
if (tunnel->server_sock >= 0) {
......@@ -1628,15 +1628,15 @@ remmina_ssh_shell_thread(gpointer data)
/* TODO: We should have a callback that intercept an x11 request to use
* ssh_channel_accept_x11 */
//if ( ret != SSH_OK ) {
//g_print ("[SSH] X11 channel error: %d\n", ret);
//g_print ("[SSH] X11 channel error: %d\n", ret);
//}else {
//ssh_channel_accept_x11 ( channel, 50);
//ssh_channel_accept_x11 ( channel, 50);
//}
if (shell->exec && shell->exec[0]) {
ret = ssh_channel_request_exec(channel, shell->exec);
}else {
}else {
ret = ssh_channel_request_shell(channel);
}
if (ret) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment