]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-make-storedata-use-unsigned-values-so-quota-cant-get-corrupted-20011226
authorNickolai Zeldovich <kolya@mit.edu>
Wed, 26 Dec 2001 20:58:07 +0000 (20:58 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 26 Dec 2001 20:58:07 +0000 (20:58 +0000)
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
src/viced/afsfileprocs.c

index aa210a8b12ca8c4c33fd3552ebc525b180fcab44..549b5badf8cdef840b242ad4356d0461bd876727 100644 (file)
@@ -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;
index 69b880bf18ea2f7a77bce9159d537780b572c2fd..7aec8c7066590cd123c3fda686709f308ffe5676 100644 (file)
@@ -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;