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>
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