Displaying 20 results from an estimated 29 matches for "connection_out".
Did you mean:
connection_get
2013 Jul 10
1
connection_in and connection_out
Hi,
I'm a newbie to openssh and was trying to read the source code recently.
Could anyone tell me why in sshd the connection_in and connection_out are the same(seems to be integer 3 in my machine).
connection_in is used in process_input(readset), and connection_out is used in process_output(writeset);
But how does it work if it tries to read and write from the same file descriptor?
/Bob
2015 May 23
5
Name based SSH proxy
...p1/sshconnect.c.original openssh-6.6p1/sshconnect.c
--- openssh-6.6p1/sshconnect.c.original 2015-05-23 11:56:55.235217137 +0200
+++ openssh-6.6p1/sshconnect.c 2015-05-23 13:43:41.426983727 +0200
@@ -515,12 +515,13 @@ ssh_connect(const char *host, struct add
}
static void
-send_client_banner(int connection_out, int minor1)
+send_client_banner(int connection_out, int minor1, const char *host)
{
/* Send our own protocol version identification. */
if (compat20) {
- xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n",
- PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION);
+ xaspri...
2001 Aug 20
1
Idletimeout patch, third attempt
...packet_read_poll2(payload_len_ptr):
packet_read_poll1(payload_len_ptr);
+ idletimeout_check(type);
if(compat20) {
int reason;
if (type != 0)
@@ -1217,12 +1301,12 @@
sizeof(fd_mask));
packet_write_poll();
while (packet_have_data_to_write()) {
- memset(setp, 0, howmany(connection_out + 1, NFDBITS) *
- sizeof(fd_mask));
- FD_SET(connection_out, setp);
- while (select(connection_out + 1, NULL, setp, NULL, NULL) == -1 &&
- (errno == EAGAIN || errno == EINTR))
- ;
+ do {
+ memset(setp, 0, howmany(connection_out + 1, NFDBITS) *
+ sizeo...
2001 Oct 31
2
suggested fix for the sigchld race
...data going to the client, mark that
@@ -278,6 +319,8 @@
error("select: %.100s", strerror(errno));
} else if (ret == 0 && client_alive_scheduled)
client_alive_check();
+
+ notify_done(*readsetp);
}
/*
@@ -467,6 +510,8 @@
connection_in = packet_get_connection_in();
connection_out = packet_get_connection_out();
+ notify_setup();
+
previous_stdout_buffer_bytes = 0;
/* Set approximate I/O buffer size. */
@@ -572,6 +617,7 @@
max_fd = MAX(max_fd, fdin);
max_fd = MAX(max_fd, fdout);
max_fd = MAX(max_fd, fderr);
+ max_fd = MAX(max_fd, notify_pipe[0]);
/* Sle...
2001 Oct 18
1
Patch for SSH-tunneling via HTTPS-proxy
...e proxy
+ *
+ * this nice patch was brought to you by Leif Jakob <openssh at jakob.weite-welt.com>, don't blame me
+ * if someone is abusing your misconfigured proxies :) but some broken firewalls require this feature
+ */
+void
+https_proxy_handshake(const char *connect_string)
+{
+ int connection_out = packet_get_connection_out();
+
+#define PROXY1 "CONNECT "
+#define PROXY3 " HTTP/1.0\r\n\r\n"
+
+ if (atomicio(write, connection_out, PROXY1, sizeof(PROXY1)-1) != sizeof(PROXY1)-1)
+ fatal("write proxy1: %.100s", strerror(errno));
+
+ if (atomicio(write, connect...
2018 Dec 10
2
[PATCH] cleanup of global variables server/client_version_string in sshconnect.c
...*server_version_string = NULL;
-struct sshkey *previous_host_key = NULL;
+static struct sshkey *previous_host_key = NULL;
static int matching_host_key_dns = 0;
@@ -605,16 +603,16 @@ ssh_connect(struct ssh *ssh, const char *host, struct addrinfo *addrs,
}
static void
-send_client_banner(int connection_out, int minor1)
+send_client_banner(int connection_out, int minor1, char **client_version_stringp)
{
/* Send our own protocol version identification. */
- xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n",
+ xasprintf(client_version_stringp, "SSH-%d.%d-%.100s\r\n",...
2006 Apr 22
2
bug & patch in ServerAliveInterval (openssh 4.3-p2)
...else {
+ else if(tv.tv_sec == 0 && tv.tv_usec == 0) {
tv.tv_sec = options.server_alive_interval;
tv.tv_usec = 0;
tvp = &tv;
}
ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp);
+ if(FD_ISSET(connection_out, *readsetp)) {
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ }
if (ret < 0) {
char buf[100];
2007 Jul 24
1
ssh client does not timeout if the network fails after ssh_connect but before ssh_exchange_identification, even with Alive options set
Hello,
I am testing ssh with occasional network disconnection between server and
client during these days. I found ssh sometimes hangs if the disconnection
happens after the connection is established but before
ssh_exchange_identification completes. The ssh configuration files show that
both client and server alive options are set.
In /etc/ssh/ssh_config:
# Send keepalive messages to the server.
2007 Mar 14
1
sshd gets stuck: select() in packet_read_seqnr waits indefinitely
Dear OpenSSH Portable sshd developers,
I'm having a problem where sshd login sessions are occasionally
(as often as once a day) getting stuck indefinitely. I enabled debug
messages and got a backtrace of a stuck sshd, and I think I've found
the bug. I wanted to run it by the list once before filing.
sshd version:
OpenSSH_4.2p1 FreeBSD-20050903, OpenSSL 0.9.7e-p1 25 Oct 2004
2000 Oct 30
1
Compatibility with 1.2.16 (commercial)?
Hi folks,
I'm currently trying to connect to version 1.2.16 of the commercial
server. The server says it supports protocol version 1.4 and that that
is incompatible with protocol version 1.5. Is that actually true? The
complete output from "ssh -v xxxxxxx" is:
$ ./ssh -v xxxxxxx
SSH Version OpenSSH_2.3.0p1, protocol versions 1.5/2.0.
Compiled with SSL (0x0090581f).
debug:
2013 Aug 02
9
[Bug 2139] New: re-exec fallback problem
https://bugzilla.mindrot.org/show_bug.cgi?id=2139
Bug ID: 2139
Summary: re-exec fallback problem
Product: Portable OpenSSH
Version: -current
Hardware: Other
OS: FreeBSD
Status: NEW
Severity: minor
Priority: P5
Component: sshd
Assignee: unassigned-bugs at mindrot.org
2000 Jan 22
0
Solaris 2.5.1 patch
...cket.c openssh-1.2.1pre27/packet.c
--- old/openssh-1.2.1pre27/packet.c Thu Jan 13 22:45:50 2000
+++ openssh-1.2.1pre27/packet.c Sat Jan 22 10:32:14 2000
@@ -138,6 +138,8 @@
struct sockaddr_storage to;
socklen_t tolen;
+ tolen = sizeof(to);
+
memset(&to, 0, sizeof(to));
if (getsockname(connection_out, (struct sockaddr *)&to, &tolen) < 0)
return 0;
2000 Mar 01
0
Problem in sshconnect.c?
...appreciated.
Regards,
Paul Tiemann
//------------- Here's a code snip from the sshconnect.c file below
void
ssh_exchange_identification()
{
char buf[256], remote_version[256]; /* must be same size! */
int remote_major, remote_minor, i;
int connection_in = packet_get_connection_in();
int connection_out = packet_get_connection_out();
/* Read other side\'s version identification. */
for (i = 0; i < sizeof(buf) - 1; i++) {
buf[i + 1] = 0;
if (read(connection_in, &buf[i], 1) != 1)
fatal("ssh_exchange_identification: read: %.100s", strerror(errno));
if (buf[i] == ...
2000 Jul 10
1
OpenSSH port to ReliantUNIX
....c Thu Jun 22 13:32:31 2000
+++ openssh-2.1.1p2/packet.c Mon Jul 10 15:28:10 2000
@@ -48,6 +48,10 @@
#define DBG(x)
#endif
+#ifdef SNI
+#undef IP_TOS
+#endif
+
/*
* This variable contains the file descriptors used for communicating with
* the other side. connection_in is used for reading; connection_out for
2002 Mar 19
2
openssh 3.1p1: ToS trouble
Hi,
I noticed that the Type of Service bit for minimize delay is set in
client->server packets only. Is this OS-specific or is there another
reason for this?
Here is a tcpdump of an interactive connection:
217.225.98.212.22 > 134.169.34.19.45870: P 1:49(48) ack 48 win 12008 (DF)
134.169.34.19.45870 > 217.225.98.212.22: P 48:96(48) ack 49 win 25416 (DF) [tos 0x10]
217.225.98.212.22
2004 Mar 26
2
Patch for login exchange timeout
...+ static void
+ grace_alarm_handler(int sig)
+ {
+ /* Log error and exit. */
+ fatal("Timeout before authentication"); }
+
+ /*
* Waits for the server identification string, and
sends our own
* identification string.
*/
***************
*** 441,446 ****
--- 451,462 ----
int connection_out = packet_get_connection_out();
int minor1 = PROTOCOL_MINOR_1;
+ /* Setup a handler for banner prompt */
+ if (options.connection_timeout > 0) {
+ signal(SIGALRM, grace_alarm_handler);
+ alarm(options.connection_timeout);
+ }
+
/* Read other side\'s version identification....
2001 Aug 16
4
Idletimeout patch
...ns;
/*
* Initializes the server options to special values that indicate that they
diff -ru openssh-2.9p2.orig/serverloop.c openssh-2.9p2/serverloop.c
--- openssh-2.9p2.orig/serverloop.c Sat Apr 14 02:28:03 2001
+++ openssh-2.9p2/serverloop.c Thu Aug 16 14:12:14 2001
@@ -79,7 +79,8 @@
static int connection_out; /* Connection to client (output). */
static int connection_closed = 0; /* Connection to client closed. */
static u_int buffer_high; /* "Soft" max buffer size. */
-
+static time_t idletime_last=0; /* The last time something happened
+ * for idletimeout. */
/*
* This SIGCHLD kludge...
1999 Dec 06
1
Ugly patch to openssh-1.2pre15
...low some lines before getting
+ the SSH-%d.%d identification string */
+ #define FIREWALL_CHATTER_LINES 10
+
/* Session id for the current session. */
unsigned char session_id[16];
***************
*** 896,902 ****
--- 902,910 ----
int connection_in = packet_get_connection_in();
int connection_out = packet_get_connection_out();
extern Options options;
+ int chatter;
+ for (chatter = 0; chatter < FIREWALL_CHATTER_LINES; chatter++) {
/* Read other side\'s version identification. */
for (i = 0; i < sizeof(buf) - 1; i++) {
if (read(...
2001 May 18
0
PATCH: implement delay (sleep) after last tunnelled connection exits
....math.ualberta.ca/~bowman
diff -ur openssh-2.9p1/clientloop.c openssh-2.9p1S/clientloop.c
--- openssh-2.9p1/clientloop.c Fri Apr 20 06:50:51 2001
+++ openssh-2.9p1S/clientloop.c Thu May 17 21:41:44 2001
@@ -121,8 +121,8 @@
static int connection_in; /* Connection to server (input). */
static int connection_out; /* Connection to server (output). */
static int need_rekeying; /* Set to non-zero if rekeying is requested. */
-static int session_closed = 0; /* In SSH2: login session closed. */
-
+enum SessionStatus {SessionOpen, SessionClose, SessionWait};
+static int session_status = SessionOpen; /* In SSH2:...
2002 Jan 27
0
[PATCH] Add an exit delay to Openssh-3.0.2p1 for use in tunneling
...50:11 2002
@@ -84,6 +84,7 @@
/* import options */
extern Options options;
+extern int no_tty_flag;
/* Flag indicating that stdin should be redirected from /dev/null. */
extern int stdin_null_flag;
@@ -122,7 +123,8 @@
static int connection_in; /* Connection to server (input). */
static int connection_out; /* Connection to server (output). */
static int need_rekeying; /* Set to non-zero if rekeying is requested. */
-static int session_closed = 0; /* In SSH2: login session closed. */
+enum SessionStatus {SessionOpen, SessionClose, SessionWait};
+static int session_status = SessionOpen; /* In SSH2: l...