OpenSSH 2.4.0 patch call..

Kevin Steves stevesk at pobox.com
Mon Jan 1 11:27:25 EST 2001


On Fri, 29 Dec 2000, Markus Friedl wrote:
: mysignal can fallback to signal if sigaction is not available.
: with mysignal() we don't need to reinstall signalhandlers.
: 
: comments?

i'm rather far away from my stevens apue.

with the patch below hp-ux 11.11 is working with protocol 2 (i did not
include the patch for signal() -> mysignal()).

why is scp using sigaction() with SA_RESTART flags in the portable
version?  it seems EINTR is handled in atomicio() without that.

Index: ssh.h
===================================================================
RCS file: /var/cvs/openssh/ssh.h,v
retrieving revision 1.49
diff -u -r1.49 ssh.h
--- ssh.h	2000/12/22 01:44:00	1.49
+++ ssh.h	2001/01/01 00:03:02
@@ -500,6 +500,10 @@
 /* set filedescriptor to non-blocking */
 void	set_nonblock(int fd);
 
+/* wrapper for signal interface */
+typedef void (*mysig_t)(int);
+mysig_t mysignal(int sig, mysig_t act);
+
 /*
  * Performs the interactive session.  This handles data transmission between
  * the client and the program.  Note that the notion of stdin, stdout, and
Index: util.c
===================================================================
RCS file: /var/cvs/openssh/util.c,v
retrieving revision 1.4
diff -u -r1.4 util.c
--- util.c	2000/10/28 03:19:58	1.4
+++ util.c	2001/01/01 00:03:03
@@ -94,3 +94,25 @@
 
 	return (old);
 }
+
+mysig_t
+mysignal(int sig, mysig_t act)
+{
+#ifdef HAVE_SIGACTION
+	struct sigaction sa, osa;
+
+	if (sigaction(sig, 0, &osa) == -1)
+		return (mysig_t) -1;
+	if (osa.sa_handler != act) {
+		memset(&sa, 0, sizeof sa);
+		sigemptyset(&sa.sa_mask);
+		sa.sa_flags = 0;
+		sa.sa_handler = act;
+		if (sigaction(sig, &sa, 0) == -1)
+			return (mysig_t) -1;
+	}
+	return (osa.sa_handler);
+#else
+	return (signal(sig, act));
+#endif
+}






More information about the openssh-unix-dev mailing list