smbd/reply: convert free space to 16bit in dskattr handler
authorDavid Disseldorp <ddiss@samba.org>
Mon, 16 Feb 2015 18:26:23 +0000 (19:26 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 17 Feb 2015 02:08:07 +0000 (03:08 +0100)
commit4ab0e57f1073e776b8832f5edc3dca04ef903fef
tree5911354bd5d149534284f692a5e10cb3cc359a52
parent2501afe08b94a514d8e2f3eeb4a2c4edc9764979
smbd/reply: convert free space to 16bit in dskattr handler

The deprecated Core Protocol dskattr SMB_COM_QUERY_INFORMATION_DISK
command provides free space information in the form of 16-bit words.

Until now, this has been handled by passing the dskattr specific
small_query boolean through to disk_norm() via the SMB_VFS_DISK_FREE VFS
hook. disk_norm(small_query=true) then modifies the block size and free
space values such that they fit in the 16-bit field.

This change adds the command specific logic to the dskattr handler, so
that it can be removed from the SMB_VFS_DISK_FREE()->disk_norm() code
path. In doing so, it fixes dskattr request handling against opaque VFS
backends that don't call disk_norm(), such as vfs_glusterfs.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/reply.c