VirtualBox

Ticket #19453 (new defect)

Opened 3 months ago

Last modified 3 months ago

OS/2 shared folders found error for DOS programs

Reported by: FelixG Owned by:
Component: guest additions Version: VirtualBox 6.1.4
Keywords: OS/2, Shared folders Cc:
Guest type: other Host type: all

Description

I found 2 errors causing shared folders on OS/2 to not be able to correctly display file names in DOS windows and old DOS programs.

It is easily verifiable with DIR in a DOS window. Files in 8.3 name format should be displayed.

File: VboxSFFind.cpp

Function: vboxSfOs2IsUtf16Name8dot3

Replace: if (off >= offMax)

by: if (off > offMax)

Replace: if (ch != '.')

by: if (ch == '.')

Thanks and regards.

Change History

comment:1 Changed 3 months ago by FelixG

I use the same ticket to give a solution to the problem of shared folders not working in some WPS.


File: VboxSFFind.cpp

Function: vboxSfOs2ReadDirEntries

Add below: EaOp.fpFEAList = (PFEALIST)pbData;

/* Maximum FEALIST size: */
if (pDataBuf->fLongFilenames)
| | (pEntry->cucShortName == 0)

EaOp.fpFEAList->cbList = cbData - 2 - (pEntry->name.u16Length / sizeof(RTUTF16));

else

EaOp.fpFEAList->cbList = cbData - 2 - (pEntry->cucShortName);


File: VboxSF.cpp

Function: vboxSfOs2MakeEmptyEaListEx

Provisionally cancel:

/* if ((char *)memchr(pszNameBuf, '\0', cbName) != &pszNameBuf[cbName])

{

cbDstList = pbSrc - 1 - (uint8_t *)pEaOp->fpGEAList;
rc = KernCopyOut(poffError, &cbDstList, sizeof(pEaOp->oError));
if (rc == NO_ERROR)

rc = ERROR_INVALID_EA_NAME;

Log(("vboxSfOs2MakeEmptyEaList: ERROR_INVALID_EA_NAME\n"));
break;

} */

I do not know the reason why the above does not work, but I propound 2 possible causes:

a) The lists may be of type GEA2 and FEA2

typedef struct _GEA2 {

ULONG oNextEntryOffset; <-- would be missing
BYTE cbName;
CHAR szname [ ? ];

} GEA2;
typedef struct _FEA2 {

ULONG NextEntryOffset; <-- would be missing
BYTE fEA;
BYTE cbName;
USHORT cbValue;
CHAR szName [ ? ];
BYTE bValue [ ? ];

} FEA2;

b) GEA->cbName may include the final character '\ 0'.  This seems to be in the FAT32.IFS controller.

I include the references to the awesome work they did on said driver:

FAT32/trunk/src:  http://trac.netlabs.org/fat32/browser/trunk/src?rev=0 FAT32/trunk/src/ifs/ifsea.c:  http://trac.netlabs.org/fat32/browser/trunk/src/ifs/ifsea.c FAT32/trunk/src/ifs/ifsfind.c:  http://trac.netlabs.org/fat32/browser/trunk/src/ifs/ifsfind.c

Thanks and regards.

comment:2 Changed 3 months ago by lerdmann

Since I have been working on EA support in FAT32.IFS: 1) no, on the IFS level,the FEA and GEA structures are used and NOT the FEA2 and GEA2 structures. The kernel takes care of converting between FEA and FEA2 and GEA and GEA2 respectively. 2) yes,returning an empty EA list means to return the requested EA names in the FEA structure (taking a straight copy from the GEA structure) but with a zero length value (that is,no value and cbValue=0).

comment:3 Changed 3 months ago by FelixG

You're right, I've already found the problem :D

I put the solution:


File: VboxSFFind.cpp

Function: vboxSfOs2ReadDirEntries

Add below: EaOp.fpFEAList = (PFEALIST)pbData;

/* Maximum FEALIST size: */
if (pDataBuf->fLongFilenames) | | (pEntry->cucShortName == 0)

EaOp.fpFEAList->cbList = cbData - 2 - (pEntry->name.u16Length / sizeof(RTUTF16));

else

EaOp.fpFEAList->cbList = cbData - 2 - (pEntry->cucShortName);


File: VboxSF.cpp

Function: vboxSfOs2MakeEmptyEaListEx

Replace: if ((char *)memchr(pszNameBuf, '\0', cbName) != &pszNameBuf[cbName])

by: if ((char *)memchr(pszNameBuf, '\0', (cbName + 1)) != &pszNameBuf[cbName])


comment:4 Changed 3 months ago by lerdmann

I can confirm that these changes (and the test version that FelixG had sent to me) fixes the WPS problems with the shared folders under OS/2.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use