Mailing List Archive

Portablility patch for openssh 6.0p1 configure.ac
The following patch corrects a portablility issue when compiling
openssh 6.0p1 on MirOS (aka. mirbsd). The issue is:

sftp-server.c: In function `send_statvfs':
sftp-server.c:510: error: request for member `val' in something not a structure or union
sftp-server.c:510: error: request for member `val' in something not a structure or union

The patch is:

--- configure.ac.orig 2012-04-19 05:46:38.000000000 -0600
+++ configure.ac 2012-05-03 08:25:49.429260884 -0600
@@ -3236,6 +3236,7 @@
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/param.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif


Thanks,

Pieter
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: Portablility patch for openssh 6.0p1 configure.ac [ In reply to ]
Pieter Bowman <bowman@math.utah.edu> writes:
> --- configure.ac.orig 2012-04-19 05:46:38.000000000 -0600
> +++ configure.ac 2012-05-03 08:25:49.429260884 -0600
> @@ -3236,6 +3236,7 @@
> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
> #include <sys/types.h>
> #include <sys/stat.h>
> +#include <sys/param.h>
> #ifdef HAVE_SYS_TIME_H
> # include <sys/time.h>
> #endif

<sys/param.h> includes <sys/types.h> and should always be included
before any other headers.

DES
--
Dag-Erling Smørgrav - des@des.no
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: Portablility patch for openssh 6.0p1 configure.ac [ In reply to ]
>> ...
>> Pieter Bowman <bowman@math.utah.edu> writes:
>> > --- configure.ac.orig 2012-04-19 05:46:38.000000000 -0600
>> > +++ configure.ac 2012-05-03 08:25:49.429260884 -0600
>> > @@ -3236,6 +3236,7 @@
>> > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
>> > #include <sys/types.h>
>> > #include <sys/stat.h>
>> > +#include <sys/param.h>
>> > #ifdef HAVE_SYS_TIME_H
>> > # include <sys/time.h>
>> > #endif
>>
>> <sys/param.h> includes <sys/types.h> and should always be included
>> before any other headers.
>> ...

You are probably correct. However, after examining the full source of
OpenSSH, I find that in most cases <sys/types.h> precedes
<sys/param.h>. I could generate patches to "fix" all instances, but
that might be better for one of the OpenSSH developers to handle.

Pieter
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: Portablility patch for openssh 6.0p1 configure.ac [ In reply to ]
On Thu, May 03, 2012 at 07:17:09PM +0200, Dag-Erling Smørgrav wrote:
> Pieter Bowman <bowman@math.utah.edu> writes:
> > --- configure.ac.orig 2012-04-19 05:46:38.000000000 -0600
> > +++ configure.ac 2012-05-03 08:25:49.429260884 -0600
> > @@ -3236,6 +3236,7 @@
> > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
> > #include <sys/types.h>
> > #include <sys/stat.h>
> > +#include <sys/param.h>
> > #ifdef HAVE_SYS_TIME_H
> > # include <sys/time.h>
> > #endif
>
> <sys/param.h> includes <sys/types.h> and should always be included
> before any other headers.

Indeed, the OpenBSD style guide says to include only one of these two as
the first include. That said, doing includes portably is a massive
headache, so actually doing this in all the source files is likely to
break something somewhere.

Anyway, I've committed a change of sys/types.h to sys/params.h for just
this test (similar to a couple of other tests in configure) which should
resolve the problem.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev