Windows: correct "fs quota" pioctl validation check

The validation check for the response from the GetVolumeStatus
pioctl is incorrect.  The response is not simply a VolumeStatus
structure but also several C strings appended to it.

LICENSE MIT

Change-Id: Ieb0c0cd166f85e073431890f51f735958776eb74
Reviewed-on: http://gerrit.openafs.org/1883
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2010-05-02 09:21:48 -04:00 committed by Jeffrey Altman
parent 715670cbe9
commit 1b4b0b7576

View File

@ -1891,12 +1891,16 @@ QuotaCmd(struct cmd_syndesc *as, void *arock)
blob.in_size = 0;
blob.out = space;
code = pioctl_utf8(ti->data, VIOCGETVOLSTAT, &blob, 1);
if (code || blob.out_size != sizeof(*status)) {
/*
* The response is VolumeStatus, volume name, offline message, and motd
*/
if (code || blob.out_size < sizeof(*status)) {
Die(errno, ti->data);
error = 1;
continue;
}
status = (VolumeStatus *)space;
status = (VolumeStatus *)space;
if (status->MaxQuota)
quotaPct = ((((double)status->BlocksInUse)/status->MaxQuota) * 100.0);
else