This is needed to be able to support statfs operation on an SSH filesystem (http://fuse.sourceforge.net/sshfs.html). It uses and sends only those fields of struct statfs which are common with struct statvfs as defined by POSIX, and which are shared among most UNIX-like systems. The SSH_FXP_EXTENDED message type is used, so this change is backward compatible and conforms to the protocol specification.
Created attachment 1393 [details] [PATCH] add statfs extension to sftp-server
Wouldn't this be better as a statvfs method? OpenBSD doesn't yet support it, but it will soon.
Sure, I'll update the patch to use statvfs. When is this support planned?
Created attachment 1475 [details] statvfs support for client and server This diff implements a statvfs@openssh.com method in the server and adds a "df" command to the client to use it: sftp> df Size Used Avail (root) %Capacity 33003120 11227184 20125792 21775936 34% sftp> df -h Size Used Avail (root) %Capacity 31.5GB 10.7GB 19.2GB 20.8GB 34% sftp> df -i Inodes Used Avail (root) %Capacity 545662 110326 435336 435336 20%
Thanks. One small comment about the patch: This line in process_extended_fstatvfs() is wrong, it shouldn't be there: + id = get_int();
Patch committed (with the suggested fix), this will be in OpenSSH 5.1. Thanks!
Mass update RESOLVED->CLOSED after release of openssh-5.1