Commit af0badf9 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

RISC OS Ltd changes merged onto trunk.

Detail:
  (extracted from BuffyLog)
  * Fixed problem with > 67 character filenames in OS_FSControl 26-28.
    buffer now fixed at 256 characters but lengths are now checked.

  * Paths may now be of any length without crashing fileswitch. On some
    occasions errors will be returned for long filenames (usually
    buffer overflow), but it will never crash. This does not stop other
    code (usually upcall handlers) from crashing the machine.
Admin:
  Not tested (TM). Shout at me if it doesn't work.

Version 2.51. Tagged as 'FileSwitch-2_51'
parent e5079366
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
*| => &.Arthur.NetFS.Asmbl200
*Obey -c <Obey$Dir>.AsmCommon OldOS RM200 NetFS200
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
*| ==> &.Arthur.NetFS.Asmbl300
*Obey -c <Obey$Dir>.AsmCommon NewOS RM300 NetFS300
Version 2.42 (MBullock - 10 Mar 1999)
* Fixed problem with > 67 character filenames in OS_FSControl 26-28.
buffer now fixed at 256 characters but lengths are now checked.
* Paths may now be of any length without crashing fileswitch. On some occasions
errors will be returned for long filenames (usually buffer overflow), but it will
never crash. This does not stop other code (usually upcall handlers) from crashing
the machine.
\ No newline at end of file
RISCOS Ltd notes on FileSwitch
==============================
Author: Justin Fletcher
Date: 26 Mar 1999
Summary
-------
FileSwitch had a number of bugs in it when dealing with long filenames. These
prevented it from performing some operations on files whose components were
greater than 64 characters, or where the total length exceeded 1024 characters.
Limitations have been more strictly adhered to now.
......@@ -6,9 +6,9 @@
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "2.50"
Module_Version SETA 250
Module_MajorVersion SETS "2.51"
Module_Version SETA 251
Module_MinorVersion SETS ""
Module_Date SETS "20 Mar 2000"
Module_FullVersion SETS "2.50"
Module_FullVersion SETS "2.51"
END
/* (2.50)
/* (2.51)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 2.50
#define Module_MajorVersion_CMHG 2.51
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 20 Mar 2000
#define Module_MajorVersion "2.50"
#define Module_Version 250
#define Module_MajorVersion "2.51"
#define Module_Version 251
#define Module_MinorVersion ""
#define Module_Date "20 Mar 2000"
#define Module_FullVersion "2.50"
#define Module_FullVersion "2.51"
......@@ -53,9 +53,9 @@ debugosbputcache MakeDebug debugosbput :LAND: False
debugosgbpb MakeDebug False
debugosgbpbentry MakeDebug debugosgbpb :LOR: False
debugdaftgbpb MakeDebug False
debugcontrol MakeDebug True
debugcontrol MakeDebug False
debugmultifs MakeDebug False
debugcontrolentry MakeDebug debugcontrol :LOR: False
debugcontrolentry MakeDebug debugcontrol :LOR:False
debugrun MakeDebug False
debugservices MakeDebug False
......@@ -116,7 +116,7 @@ $GetAroundBleedingAAsmYetAgain
[ anyfiledebug
; Set to true for dubugging through the tube
Host_Debug SETL True
Host_Debug SETL False
]
GBLS Host_Inclusion
......@@ -133,7 +133,7 @@ $Host_Inclusion
[ anyfiledebug
; Set to true to send debug output to the DebugIt module
Debug_Module SETL False
Debug_Module SETL True
[ Debug_Module
XDebugIt_WriteC EQU &0004ba82 + Auto_Error_SWI_bit
......
......@@ -1079,11 +1079,30 @@ Util_ReadDirEntry ENTRY "r0-r2, r4-r6, fscb" ; FSFunc only preserves r6 up
]
50
; If none read, but not at end, then try for another.
TEQ r3, #0
BNE %FT60
CMP r4, #-1
BNE %BT30
; MB Fix (10/3/99)
; the original code was totally broken, someone didn't read the specs
; if the buffer overruns it results in r3 == 0 and so causes an infinite loop
; Original code:
; ; If none read, but not at end, then try for another.
; TEQ r3, #0
; BNE %FT60
; CMP r4, #-1
; BNE %BT30
CMP r4,#-1 ; if r4 == -1 then we are finished
BEQ %FT60
TEQ r3,#0 ; if r3 == 0 then buffer overflow
BNE %FT60 ; else read an entry ok, so return it
; if we get here then the buffer has overflowed so return an error
addr r0, ErrorBlock_BuffOverflow
BL CopyError ; else return a buffer overflow error
SETV
EXIT
; end MB fix
60
[ debugutil
......
......@@ -808,12 +808,26 @@ StaticName_length * 1024 ; Limits size of input filename, path etc.
; Local workspace allocation: done bottom up!
; ******************************************************
; ******************************************************
; ** How this bit works... **
; ** --------------------- **
; ** **
; ** Everytime you want to add anything to any of the **
; ** sections below, increment the following value by **
; ** the amount you add. Simple... **
; ******************************************************
; ******************************************************
;
; Stuff that only wants to be local during Copy
; MB fix 15/3/99
; size of buffer for enumerating dirs has been increased to allow filenames up to 256 characters
[ UseDynamicAreas
copylocalframesize * &13c ; Change this if changing ANY frame size
copylocalframesize * &1FC ; Change this if changing ANY frame size
|
copylocalframesize * &134 ; Change this if changing ANY frame size
copylocalframesize * &1F4 ; Change this if changing ANY frame size
]
^ -copylocalframesize, fp
......@@ -893,8 +907,11 @@ util_exec # 4 ; the dest in copy; possibly restamped)
util_length # 4
util_attr # 4
util_objecttype # 4
util_objectname # 64+1 ; Only allows 64 char names as yet
; so ROMFS might have a chance
; MB fix 15/3/99
; size of buffer for enumerating dirs has been increased to allow filenames up to 256 characters
util_objectname # 256+1
AlignSpace 4 ; ROMFS does word align at odd places
util_objblksize * @ - util_load
......
......@@ -631,7 +631,18 @@ TopPath_EnsureThingIsDirectory ENTRY "r0,r1,r2"
TopPath_CopyCleanTransAndPoliceWithError ENTRY "r0,r1,r2,r4,r5,r6"
MOV r6, r0
GetLumpOfStack r5, #16, #StaticName_length, #2048, %F90
; MB Fix (10/3/99)
; original code allocated a minimum of 16 bytes for the translated path
; then didn't check for overwritting the end that's clearly very dumb...
; In low stack situations a no stack error is infinately preferable to
; stack corruption. The lack of length check is still there, but most of the
; OS will die if any path exceeds StaticName_Length.
; original code:
; GetLumpOfStack r5, #16, #StaticName_length, #2048, %F90
GetLumpOfStack r5, #StaticName_length, #StaticName_length, #2048, %F90
; end MB Fix
MOV r0, r1
MOV r1, sp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment