Displaying 20 results from an estimated 36 matches for "set_nonblock".
2000 Oct 12
1
Remote port forwarding problems
...urrently.
The command I type is:
ssh -v -R 8080:localhost:8080 <remote machine>
I've also used the machine name and ip address for the local machine.
The -v shows these curious messages:
debug: read DSA private key done
debug: sig size 20 20
debug: ssh-userauth2 successfull
debug: no set_nonblock for tty fd 4
debug: no set_nonblock for tty fd 5
debug: no set_nonblock for tty fd 6
debug: channel 0: new [client-session]
debug: send channel open 0
debug: Entering interactive session.
The no set_nonblock, is that an indication?
here's the output with
ssh -v -R 8080:localhost:8080 <rem...
2001 Jun 15
2
openssh 2.9p1: data loss when stdout sent to a pipe
...clientloop.c Fri Jun 15 14:13:32 2001
@@ -787,12 +787,15 @@
if (!compat20) {
/* enable nonblocking unless tty */
+ /* REMOVED for now since it prevents ssh command output from
+ being reliably sent to a pipe. - PHS 2001/06/15
if (!isatty(fileno(stdin)))
set_nonblock(fileno(stdin));
if (!isatty(fileno(stdout)))
set_nonblock(fileno(stdout));
if (!isatty(fileno(stderr)))
set_nonblock(fileno(stderr));
+ */
max_fd = MAX(max_fd, fileno(stdin));
max_fd = MAX(max_fd, fileno(stdout));
max_fd = MAX(max_fd, fileno(stderr));
Now, pre...
2019 Sep 16
2
ssh client is setting O_NONBLOCK on a pipe shared with other processes
> Case in point; EAGAIN can come if you give your fd to another process
> and continue using it yourself.
> Short counts; It is documented behavior that read() and write() may
> return short counts. It is not documented why, so you can not make
> any assumptions.
You might be right about short counts but if you're right about
EAGAIN, there are
bugs everywhere. My first
2001 Feb 12
1
OpenSSH 2.3.0p1 bug with SCO UnixWare 7.1.0
...SG_SERVICE_REQUEST
debug: service_accept: ssh-userauth
debug: got SSH2_MSG_SERVICE_ACCEPT
debug: authentications that can continue: publickey,password
debug: key does not exist: /home/users/rpouliot/.ssh/id_dsa
rpouliot at scyc2h.qc.bell.ca's password:
debug: ssh-userauth2 successfull
debug: no set_nonblock for tty fd 4
debug: no set_nonblock for tty fd 5
debug: no set_nonblock for tty fd 6
debug: channel 0: new [client-session]
debug: send channel open 0
debug: Entering interactive session.
debug: callback start
debug: client_init id 0 arg 0
debug: channel request 0: shell
debug: client_set_session_i...
2001 Oct 31
2
suggested fix for the sigchld race
...tween select() and child_terminated
+ */
+static int notify_pipe[2];
+static void
+notify_setup(void)
+{
+ if (pipe(notify_pipe) < 0) {
+ error("pipe(notify_pipe) failed %s", strerror(errno));
+ notify_pipe[0] = -1; /* read end */
+ notify_pipe[1] = -1; /* write end */
+ } else {
+ set_nonblock(notify_pipe[0]);
+ set_nonblock(notify_pipe[1]);
+ }
+}
+static void
+notify_parent(void)
+{
+ if (notify_pipe[1] != -1)
+ write(notify_pipe[1], "", 1);
+}
+static void
+notify_prepare(fd_set *readset)
+{
+ if (notify_pipe[0] != -1)
+ FD_SET(notify_pipe[0], readset);
+}
+static void
+n...
2000 Sep 27
2
trouble logging out when using protocol version 2
...bug: buggy server: service_accept w/o service
debug: got SSH2_MSG_SERVICE_ACCEPT
debug: authentications that can continue: publickey,password
debug: try pubkey: /home/jbw/.ssh/id_dsa
debug: read DSA private key done
debug: sig size 20 20
debug: datafellows
debug: ssh-userauth2 successfull
debug: no set_nonblock for tty fd 4
debug: no set_nonblock for tty fd 5
debug: no set_nonblock for tty fd 6
debug: channel 0: new [client-session]
debug: send channel open 0
debug: Entering interactive session.
debug: callback start
debug: client_init id 0 arg 0
debug: Sending command: id
debug: client_set_session_ident:...
2020 Apr 28
2
[PATCH nbdkit] server: Fix parameters of lock_request, unlock_request
Patch itself is not controversial.
However I do wonder if we want to change all these constructs so that
instead of using #ifdef we use something like:
if (HAVE_PIPE2) {
// normal path
}
else {
// fallback
}
(It wouldn't actually work as written above because HAVE_PIPE2 is not
always defined, but you get the idea.)
This would allow us to test that the fallback paths still
2020 Apr 28
0
[PATCH nbdkit] server: Fix parameters of lock_request, unlock_request on fallback path.
...*/
assert (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS);
- lock_request (NULL);
+ lock_request ();
if (pipe (conn->status_pipe)) {
perror ("pipe");
- unlock_request (NULL);
+ unlock_request ();
goto error2;
}
if (set_nonblock (set_cloexec (conn->status_pipe[0])) == -1) {
perror ("fcntl");
close (conn->status_pipe[1]);
- unlock_request (NULL);
+ unlock_request ();
goto error2;
}
if (set_nonblock (set_cloexec (conn->status_pipe[1])) == -1) {
perror ("...
2019 Aug 27
1
[PATCH nbdkit] server: Try hard to maintain invariant that fds 0, 1 and 2 are always open.
...s/utils.h b/common/utils/utils.h
index ebd5f66..a77d2cd 100644
--- a/common/utils/utils.h
+++ b/common/utils/utils.h
@@ -38,5 +38,6 @@ extern void uri_quote (const char *str, FILE *fp);
extern int exit_status_to_nbd_error (int status, const char *cmd);
extern int set_cloexec (int fd);
extern int set_nonblock (int fd);
+extern void close_or_nullify_fd (int fd);
#endif /* NBDKIT_UTILS_H */
diff --git a/server/connections.c b/server/connections.c
index c173df8..f57ab3e 100644
--- a/server/connections.c
+++ b/server/connections.c
@@ -489,7 +489,7 @@ static void
raw_close (struct connection *conn)
{...
2017 Jan 12
3
proposed change to ssh_connect_direct()
On Sat, Jan 7, 2017 at 2:30 PM, Peter Moody <mindrot at hda3.com> wrote:
> so I spent a bit of time looking at this and it seems like the only
> way to go, at least if I want to keep it in ssh_connect_direct(), is
> to use pthreads. further, it seems like getting that accepted is
> something of a long shot:
Sorry, pthreads is a non-starter.
I would have thought that using
2000 Aug 31
1
slightly overzealous RNG seeding?
...key does not exist: //.ssh/id_dsa
root at qabigip1's password:
debug: Seeded RNG with 34 bytes from programs
debug: Seeded RNG with 3 bytes from system calls
debug: Seeded RNG with 34 bytes from programs
debug: Seeded RNG with 3 bytes from system calls
debug: ssh-userauth2 successfull
debug: no set_nonblock for tty fd 7
debug: no set_nonblock for tty fd 8
debug: no set_nonblock for tty fd 9
debug: channel 0: new [client-session]
debug: send channel open 0
debug: Seeded RNG with 34 bytes from programs
debug: Seeded RNG with 3 bytes from system calls
debug: Seeded RNG with 34 bytes from programs
debug:...
2000 Jul 15
0
openssh-2.1.1p3 - problem with -i option
...t;/dev/pts/8"
Jul 15 14:06:09 somehost PAM_pwdb[27621]: (sshd) session opened for user dummy by (uid=0)
Jul 15 14:06:09 somehost sshd[27621]: debug: PAM establishing creds
Jul 15 14:06:09 somehost sshd[27621]: debug: Entering interactive session.
Jul 15 14:06:09 somehost sshd[27621]: debug: no set_nonblock for tty fd 0
Jul 15 14:06:09 somehost sshd[27622]: debug: Setting controlling tty using TIOCSCTTY.
Jul 15 14:06:09 somehost sshd[27621]: debug: no set_nonblock for tty fd 7
Jul 15 14:06:09 somehost sshd[27621]: debug: server_init_dispatch_13
Jul 15 14:06:09 somehost sshd[27621]: debug: server_init_...
2000 Aug 07
1
X11-Forwarding OpenSSH 2.1.1p4 problem
...done: send SSH2_MSG_NEWKEYS.
debug: done: KEX2.
debug: send SSH2_MSG_SERVICE_REQUEST
debug: service_accept: ssh-userauth
debug: got SSH2_MSG_SERVICE_ACCEPT
debug: authentications that can continue: publickey,password
debug: key does not exist: /.ssh/id_dsa
debug: ssh-userauth2 successfull
debug: no set_nonblock for tty fd 4
debug: no set_nonblock for tty fd 5
debug: fd 6 setting O_NONBLOCK
debug: channel 0: new [client-session]
debug: send channel open 0
debug: Entering interactive session.
debug: callback start
debug: client_init id 0 arg 0
debug: Requesting X11 forwarding with authentication spoofing.
d...
2020 Apr 15
2
Re: [PATCH nbdkit 6/9] common/utils: Add a copy_environ utility function.
...++++++++++++
> 3 files changed, 119 insertions(+)
>
> +++ b/common/utils/utils.h
> @@ -38,5 +38,6 @@ extern void uri_quote (const char *str, FILE *fp);
> extern int exit_status_to_nbd_error (int status, const char *cmd);
> extern int set_cloexec (int fd);
> extern int set_nonblock (int fd);
> +extern char **copy_environ (char **env, ...);
Should use __attribute__((sentinel)), to let the compiler enforce that
we don't forget a trailing NULL.
> +++ b/common/utils/environ.c
> +
> +DEFINE_VECTOR_TYPE(environ_t, char *);
> +
> +/* Copy an environ. Also...
2004 Jul 12
2
[PATCH] Batch-mode rewrite
...d on the sender. */
+
+ /* TODO: I suspect this limitation can be removed. */
if (!read_batch) {
recv_exclude_list(f_in);
if (cvs_exclude)
***************
*** 609,623 ****
char *local_name = NULL;
cleanup_child_pid = pid;
! if (read_batch)
! flist = batch_flist;
set_nonblocking(f_in);
set_nonblocking(f_out);
setup_protocol(f_out,f_in);
! if (protocol_version >= 23)
io_start_multiplex_in(f_in);
if (am_sender) {
--- 633,658 ----
char *local_name = NULL;
cleanup_child_pid = pid;
! if (read_batch) {
! close(f_in);
! close(f_out);...
2001 Aug 06
1
merge rsync+ into rsync (was Re: rsync-2.4.7 NEWS file)
> Just curious: what about the rsync+ patch?
Thanks for the reminder.
I've just committed Jos's rsync+ patch onto the
"branch_mbp_rsyncplus_merge" branch. If it works OK and nobody
screams I will move it across onto the main tree tomorrow or
Wednesday.
I see the patch doesn't add documentation about the new options to the
man page, so we should fix that in the future.
2020 Apr 15
0
Re: [PATCH nbdkit 6/9] common/utils: Add a copy_environ utility function.
...hanged, 119 insertions(+)
> >
>
> >+++ b/common/utils/utils.h
> >@@ -38,5 +38,6 @@ extern void uri_quote (const char *str, FILE *fp);
> > extern int exit_status_to_nbd_error (int status, const char *cmd);
> > extern int set_cloexec (int fd);
> > extern int set_nonblock (int fd);
> >+extern char **copy_environ (char **env, ...);
>
> Should use __attribute__((sentinel)), to let the compiler enforce
> that we don't forget a trailing NULL.
Ooops ... I had this in an earlier version and somehow
managed to drop it :-( I think when it was originall...
2018 Feb 23
7
RFC 8305 Happy Eyeballs in OpenSSH
...s)
{
- int optval = 0;
- socklen_t optlen = sizeof(optval);
+ if (timeout_ms <= 0)
+ return 0;
+ ms_subtract_diff(tv, &timeout_ms);
+ return timeout_ms <= 0;
+}
- /* No timeout: just do a blocking connect() */
- if (*timeoutp <= 0)
- return connect(sockfd, serv_addr, addrlen);
-
- set_nonblock(sockfd);
- if (connect(sockfd, serv_addr, addrlen) == 0) {
- /* Succeeded already? */
- unset_nonblock(sockfd);
+/*
+ * Return 0 if the addrinfo was not tried. Return -1 if using it
+ * failed. Return 1 if it was used.
+ */
+static int
+ssh_connect_happy_eyeballs_initiate(const char *host, struct...
2007 Aug 03
1
race condition with ControlMaster=auto
...ts",
- options.control_path);
- else
+ if (errno != EINVAL && errno != EADDRINUSE)
fatal("%s bind(): %s", __func__, strerror(errno));
+ return 0;
}
umask(old_umask);
@@ -1085,6 +1084,9 @@
fatal("%s listen(): %s", __func__, strerror(errno));
set_nonblock(control_fd);
+
+ debug("control master listening on %s", options.control_path);
+ return 1;
}
/* request pty/x11/agent/tcpfwd/shell for channel */
@@ -1201,7 +1203,9 @@
/* XXX should be pre-session */
ssh_init_forwarding();
- ssh_control_listener();
+ if (!ssh_control_listener(0...
2001 Nov 20
2
rsync server over SSH [includes code patches]
...(int fd)
{
char line[200];
char *motd;
int i = -1;
extern char *config_file;
extern int remote_version;
if (!lp_load(config_file, 0)) {
exit_cleanup(RERR_SYNTAX);
}
! set_socket_options(fd,"SO_KEEPALIVE");
! set_socket_options(fd,lp_socket_options());
! set_nonblocking(fd);
! io_printf(fd,"@RSYNCD: %d\n", PROTOCOL_VERSION);
motd = lp_motd_file();
if (motd && *motd) {
--- 394,422 ----
io_printf(fd, "%-15s\t%s\n", lp_name(i), lp_comment(i));
}
! /* this is called when a connection is established to a client...