diff options
author | Darren Tucker <dtucker@zip.com.au> | 2008-06-09 06:17:53 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2008-06-09 06:17:53 +1000 |
commit | 77001384cc067a4613dd6d7a07b9a786f7d7f1bb (patch) | |
tree | 5f1eb47742ba656c70a291af95f442539e99d104 | |
parent | 598eaa6c0c36c3169963c7e6505d53b4073590f5 (diff) | |
download | openssh-git-77001384cc067a4613dd6d7a07b9a786f7d7f1bb.tar.gz |
- (dtucker) [configure.ac defines.h sftp-client.c M sftp-server.c] Add a
macro to convert fsid to unsigned long for platforms where fsid is a
2-member array.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | defines.h | 11 | ||||
-rw-r--r-- | sftp-server.c | 2 |
4 files changed, 27 insertions, 5 deletions
@@ -3,6 +3,9 @@ openbsd-compat/Makefile.in openbsd-compat/openbsd-compat.h openbsd-compat/bsd-statvfs.{c,h}] Add a null implementation of statvfs and fstatvfs and remove #defines around statvfs code. ok djm@ + - (dtucker) [configure.ac defines.h sftp-client.c M sftp-server.c] Add a + macro to convert fsid to unsigned long for platforms where fsid is a + 2-member array. 20080607 - (dtucker) [mux.c] Include paths.h inside ifdef HAVE_PATHS_H. @@ -4060,4 +4063,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4943 2008/06/08 17:32:29 dtucker Exp $ +$Id: ChangeLog,v 1.4944 2008/06/08 20:17:53 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 4f3ec2a2..9f39b233 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.401 2008/06/08 17:32:29 dtucker Exp $ +# $Id: configure.ac,v 1.402 2008/06/08 20:17:53 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.401 $) +AC_REVISION($Revision: 1.402 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -3026,6 +3026,16 @@ if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then file descriptor passing]) fi +AC_MSG_CHECKING(if f_fsid has val members) +AC_TRY_COMPILE([ +#include <sys/types.h> +#include <sys/statvfs.h>], +[struct fsid_t t; t.val[0] = 0;], + [ AC_MSG_RESULT(yes) + AC_DEFINE(FSID_HAS_VAL, 1, f_fsid has members) ], + [ AC_MSG_RESULT(no) ] +) + AC_CACHE_CHECK([for msg_control field in struct msghdr], ac_cv_have_control_in_msghdr, [ AC_COMPILE_IFELSE( @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.148 2008/06/08 17:32:29 dtucker Exp $ */ +/* $Id: defines.h,v 1.149 2008/06/08 20:17:53 dtucker Exp $ */ /* Constants */ @@ -590,6 +590,15 @@ struct winsize { # define SSH_SYSFDMAX 10000 #endif +#ifdef FSID_HAS_VAL +/* encode f_fsid into a 64 bit value */ +#define FSID_TO_ULONG(f) \ + ((((u_int64_t)(f).val[0] & 0xffffffffUL) << 32) | \ + ((f).val[1] & 0xffffffffUL)) +#else +# define FSID_TO_ULONG(f) ((f)) +#endif + #if defined(__Lynx__) /* * LynxOS defines these in param.h which we do not want to include since diff --git a/sftp-server.c b/sftp-server.c index 9c312834..f6992616 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -501,7 +501,7 @@ send_statvfs(u_int32_t id, struct statvfs *st) buffer_put_int64(&msg, st->f_files); buffer_put_int64(&msg, st->f_ffree); buffer_put_int64(&msg, st->f_favail); - buffer_put_int64(&msg, st->f_fsid); + buffer_put_int64(&msg, FSID_TO_ULONG(st->f_fsid)); buffer_put_int(&msg, flag); buffer_put_int(&msg, st->f_namemax); send_msg(&msg); |