20080607
- (dtucker) [mux.c] Include paths.h inside ifdef HAVE_PATHS_H.
+ - (dtucker) [configure.ac defines.h sftp-client.c sftp-server.c sftp.c]
+ Do not enable statvfs extensions on platforms that do not have statvfs.
20080604
- (djm) [openbsd-compat/bsd-arc4random.c] Fix math bug that caused bias
sys/cdefs.h \
sys/dir.h \
sys/mman.h \
+ sys/mount.h \
sys/ndir.h \
sys/poll.h \
sys/prctl.h \
sys/stream.h \
sys/stropts.h \
sys/strtio.h \
+ sys/statvfs.h \
sys/sysmacros.h \
sys/time.h \
sys/timers.h \
sigvec \
snprintf \
socketpair \
+ statfs \
+ statvfs \
strdup \
strerror \
strlcat \
# define CUSTOM_SSH_AUDIT_EVENTS
#endif
+#if defined(HAVE_STATVFS)
+# define USE_STATVFS
+#endif
+
#if !defined(HAVE___func__) && defined(HAVE___FUNCTION__)
# define __func__ __FUNCTION__
#elif !defined(HAVE___func__)
#include <sys/types.h>
#include <sys/param.h>
+#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
+#endif
#include "openbsd-compat/sys-queue.h"
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
return(a);
}
+#ifdef USE_STATVFS
static int
get_decode_statvfs(int fd, struct statvfs *st, u_int expected_id, int quiet)
{
return 0;
}
+#endif
struct sftp_conn *
do_init(int fd_in, int fd_out, u_int transfer_buflen, u_int num_requests)
}
#endif
+#ifdef USE_STATVFS
int
do_statvfs(struct sftp_conn *conn, const char *path, struct statvfs *st,
int quiet)
return get_decode_statvfs(conn->fd_in, st, id, quiet);
}
+#endif
#ifdef notyet
int
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
+#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
+#endif
#include <dirent.h>
#include <errno.h>
buffer_free(&msg);
}
+#ifdef USE_STATVFS
static void
send_statvfs(u_int32_t id, struct statvfs *st)
{
send_msg(&msg);
buffer_free(&msg);
}
+#endif
/* parse incoming */
/* POSIX rename extension */
buffer_put_cstring(&msg, "posix-rename@openssh.com");
buffer_put_cstring(&msg, "1"); /* version */
+#ifdef USEE_STATVFS
/* statvfs extension */
buffer_put_cstring(&msg, "statvfs@openssh.com");
buffer_put_cstring(&msg, "1"); /* version */
/* fstatvfs extension */
buffer_put_cstring(&msg, "fstatvfs@openssh.com");
buffer_put_cstring(&msg, "1"); /* version */
+#endif
send_msg(&msg);
buffer_free(&msg);
}
xfree(newpath);
}
+#ifdef USE_STATVFS
static void
process_extended_statvfs(u_int32_t id)
{
else
send_statvfs(id, &st);
}
+#endif
static void
process_extended(void)
request = get_string(NULL);
if (strcmp(request, "posix-rename@openssh.com") == 0)
process_extended_posix_rename(id);
+#ifdef USE_STATVFS
else if (strcmp(request, "statvfs@openssh.com") == 0)
process_extended_statvfs(id);
else if (strcmp(request, "fstatvfs@openssh.com") == 0)
process_extended_fstatvfs(id);
+#endif
else
send_status(id, SSH2_FX_OP_UNSUPPORTED); /* MUST */
xfree(request);
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/wait.h>
+#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
+#endif
#include <ctype.h>
#include <errno.h>
static int
do_df(struct sftp_conn *conn, char *path, int hflag, int iflag)
{
+#ifdef USE_STATVFS
struct statvfs st;
char s_used[FMT_SCALED_STRSIZE];
char s_avail[FMT_SCALED_STRSIZE];
st.f_blocks));
}
return 0;
+#else
+ error("client does not support statvfs extension");
+ return -1;
+#endif
}
/*