From cfc24b966ddd97ca42ad2e5467044046cfda2488 Mon Sep 17 00:00:00 2001 From: Nickolai Zeldovich Date: Wed, 26 Dec 2001 20:58:07 +0000 Subject: [PATCH] STABLE12-make-storedata-use-unsigned-values-so-quota-cant-get-corrupted-20011226 Currently it's possible to give StoreData negative Pos/Length/FileLength arguments and thereby set the volume quota usage to arbitrary values. This patch makes these values unsigned, since negative file positions and lengths don't make sense anyway. --- src/fsint/afsint.xg | 6 +++--- src/viced/afsfileprocs.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/fsint/afsint.xg b/src/fsint/afsint.xg index aa210a8b1..549b5badf 100644 --- a/src/fsint/afsint.xg +++ b/src/fsint/afsint.xg @@ -348,9 +348,9 @@ FetchStatus( StoreData( IN AFSFid *Fid, AFSStoreStatus *InStatus, - afs_int32 Pos, - afs_int32 Length, - afs_int32 FileLength, + afs_uint32 Pos, + afs_uint32 Length, + afs_uint32 FileLength, OUT AFSFetchStatus *OutStatus, AFSVolSync *Sync ) split = 133; diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 69b880bf1..7aec8c706 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -1205,9 +1205,9 @@ SRXAFS_StoreData (tcon, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync) struct rx_connection *tcon; /* Rx connection Handle */ struct AFSFid *Fid; /* Fid of taret file */ struct AFSStoreStatus *InStatus; /* Input Status for Fid */ - afs_int32 Pos; /* Not implemented yet */ - afs_int32 Length; /* Length of data to store */ - afs_int32 FileLength; /* Length of file after store */ + afs_uint32 Pos; /* Not implemented yet */ + afs_uint32 Length; /* Length of data to store */ + afs_uint32 FileLength; /* Length of file after store */ struct AFSFetchStatus *OutStatus; /* Returned status for target fid */ { @@ -5160,9 +5160,9 @@ StoreData_RXStyle(volptr, targetptr, Fid, client, Call, Pos, Length, struct AFSFid *Fid; struct client *client; register struct rx_call *Call; - afs_int32 Pos; - afs_int32 Length; - afs_int32 FileLength; + afs_uint32 Pos; + afs_uint32 Length; + afs_uint32 FileLength; int sync; #if FS_STATS_DETAILED afs_int32 *a_bytesToStoreP; -- 2.39.5