Christian Leutloff
|
Little fix for security/openssh
|
Christian Leutloff
10/12/2007 2:22 PM
post1990
|
Little fix for security/openssh
bmake install
leads to:
...
cc -O2 -I/usr/pkg/include -Wall -Wpointer-arith -Wuninitialized -I. -I. -I/usr/pkg/include -I/usr/pkg/include -I/usr/pkg
/include -DSSHDIR=\"/usr/pkg/etc/ssh\" -D_PATH_SSH_PROGRAM=\"/usr/pkg/bin/ssh\" -D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/pkg
/bin/ssh-askpass\" -D_PATH_SFTP_SERVER=\"/usr/pkg/libexec/sftp-server\" -D_PATH_SSH_KEY_SIGN=\"/usr/pkg/libexec/ssh-
keysign\" -D_PATH_SSH_PIDDIR=\"/var/run\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/chroot/sshd\" -DSSH_RAND_HELPER=\"/usr/
pkg/libexec/ssh-rand-helper\" -DHAVE_CONFIG_H -c atomicio.c
atomicio.c: In function `atomicio':
atomicio.c:55: error: storage size of `pfd' isn't known
atomicio.c:58: error: `POLLIN' undeclared (first use in this function)
atomicio.c:58: error: (Each undeclared identifier is reported only once
atomicio.c:58: error: for each function it appears in.)
atomicio.c:58: error: `POLLOUT' undeclared (first use in this function)
atomicio.c:70: warning: implicit declaration of function `poll'
atomicio.c:55: warning: unused variable `pfd'
atomicio.c: In function `atomiciov':
atomicio.c:94: error: storage size of `pfd' isn't known
atomicio.c:104: error: `POLLIN' undeclared (first use in this function)
atomicio.c:104: error: `POLLOUT' undeclared (first use in this function)
atomicio.c:94: warning: unused variable `pfd'
cc: /usr/qnx632/host/qnx6/x86/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.5/cc1 error 1
The fix is obvious: poll is defined in sys/poll.h and need therefore to be included in atomicio.c. Then everything
compiles and works fine.
The patch for the c file is the easiest one:
# less patch-ax
$NetBSD$
On QNX the function poll() is defined in sys/poll.h and must therefore be included.
--- atomicio.c.orig 2007-06-25 14:15:12.000000000 +0200
+++ atomicio.c
@@ -35,6 +35,9 @@
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
+#ifdef HAVE_SYS_POLL_H
+#include <sys/poll.h>
+#endif
#include <string.h>
#include <unistd.h>
Then I need to define the newly introduced define HAVE_SYS_POLL_H. This has to be done through configure.ac!?
# less patch-ay
$NetBSD$
On QNX the function poll() is defined in sys/poll.h and must therefore be included.
--- configure.ac.orig 2007-08-10 06:36:12.000000000 +0200
+++ configure.ac
@@ -223,6 +227,7 @@ AC_CHECK_HEADERS( \
sys/dir.h \
sys/mman.h \
sys/ndir.h \
+ sys/poll.h \
sys/prctl.h \
sys/pstat.h \
sys/select.h \
As far as I know autoheader generates config.h.in from configure.ac. But it seems to be included in the original source.
Therefore another path is required:
# less patch-az
$NetBSD$
--- config.h.in.orig 2007-09-04 08:50:04.000000000 +0200
+++ config.h.in
@@ -636,6 +642,9 @@
/* Define to 1 if you have the <poll.h> header file. */
#undef HAVE_POLL_H
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
/* Define to 1 if you have the `prctl' function. */
#undef HAVE_PRCTL
BUT this doesn't work. HAVE_SYS_POLL_H is not defined in the generated config.h 8-((
Invoking autoheader manually does not help, too:
# autoheader
autoheader: warning: missing template: HAVE_INTERIX
autoheader: Use AC_DEFINE([HAVE_INTERIX], [], [Description])
As you see, I'm new to the autotools. Any ideas where I must look for?
If I have gotten around the remaining issue. How should I proceed to get the required changes into the QNX pkgsrc
subversion repository? Who will take care that the required change is moved upstream (NetBSD as upstream pkgsrc and
OpenBSD as openssh author)?
Thanks
Christian
|
|
|