OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_71-27-g718f85a
Gerrit Code Review
gerrit@openafs.org
Wed, 3 Feb 2010 13:30:07 -0800 (PST)
The following commit has been merged in the master branch:
commit 718f85a8b69a78ac77beb5c8471af20657be2a53
Author: Simon Wilkinson <sxw@your-file-system.com>
Date: Wed Feb 3 00:31:32 2010 +0000
Fix pioctl input and output handling
Pioctl input and output handling was being handled in an adhoc
manner, with little or no detection of input and output buffer
overflow. Whilst overflow is difficult to provoke on a real system,
due to the size of the buffers being allocated for output, the code
was difficult to read, and fragile to maintain.
This patch adds an XDR like abstraction for marshalling and
unmarshalling pioctl data. Whilst the real XDR can't be used and
maintain backwards compatibility, this gives a similar elegance.
Input and output pointers are replaced with instances of
struct afs_pdata, which store both a pointer to the current position
in the data stream, and a note of where the stream ends.
All access to a data stream is now performed through a set of helper
functions, which handle the reading and writing of integers, strings,
and arbitrary blocks of bytes. An 'inline' function is provided for
those cases where direct access to the stream is required.
Change-Id: I6ed2e8e80cebde2abc6a517f4dbef09042b47037
Reviewed-on: http://gerrit.openafs.org/1223
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/afs/afs_pioctl.c | 1220 ++++++++++++++++++++++++++++++--------------------
1 files changed, 725 insertions(+), 495 deletions(-)
--
OpenAFS Master Repository