From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emmanuel Jeandel Subject: MFS: possible bad behaviour of the function exists Date: Sat, 14 Dec 2002 14:38:36 +0100 Sender: linux-msdos-owner@vger.kernel.org Message-ID: <20021214133836.GA1585@ens-lyon.fr> Reply-To: E_Jeandel@mail.dotcom.fr Mime-Version: 1.0 Return-path: Content-Disposition: inline List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-msdos@vger.kernel.org Hello, I encountered the following problem (DOSEMU 1.1.3.4, i'm progressively updating to 1.1.3.7, but i have not seen anything about this bug in patches 1.1.3.5 through 1.1.3.7) With lredir, i associated D: with /home/foo, and E: with /home/foo/Games. Let's say i have a file bar.exe in /home/foo/Games. Now, in dosemu, if i say : PROMPT>D: PROMPT>cd Games PROMPT>bar then bar is executed However, if i execute : PROMPT>E: PROMPT>bar bar.exe is not found (it is found by "dir", by "type", but i can neither execute it nor modify it with an editor) After some debugging, i found that the problem seems to be in mfs.c : in the function exists, the ENTIRE path is lowercased, whereas the good behaviour is to lowercase only the DOS part of the path (or rather to not lowercase anything, cause find_file one line later will do this for us) That's why i observed this behaviour : in the first case, find_file is called with /home/foo/games/bar.exe, knowing that the unix part is /home/foo, and then try any combination of lower and uppercase in games/bar.exe to find that Games/bar.exe is the good one In the second case, find_file is called with /home/foo/games/bar.exe, knowing that the unix part is /home/foo/games (WRONG !), and then find nothing, cause it will not do anything about the "games" part of the folder. Then, this bug will cause the failure of any attempt to execute a file when the unix part of the path is not lowercase My suggestion will be to comment/delete the line in exists speaking about strlowerDOS. Regards, Emmanuel