No validation of the filename

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
PKEv
Junior Member
Junior Member
Posts: 3
Joined: 2015-10-12, 14:00 UTC

No validation of the filename

Post by *PKEv »

If you try to copy a file with renaming in "COM1" program hangs
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It really hangs! :D
I understand that it isn't easy at all to check all these reserved names but I agree that TC should allow cancelling such operations.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Here an error message pops up:
"Error: Can't read Filename
[Skip] [Retry]
[Skip all] .."

TC 8.52a x64 W7, all COM Ports disabled.

Workaround:
Copy to NUL :D

Regards
Holger
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

I can't confirm this issue. I get the same error message like Holger, and no hangs.

TC 8.52a, WinXP SP3 (COM1 is enabled and my infrared adapter is connected to it).

What happens when you copy some (existing) file to COM1 on CMD?

Code: Select all

copy c:\somefile COM1
I get an "Access denied" with that command.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Dalai,
It seems that it depends on Windows configuration. I was able to reproduce it on one computer (TC progress dialog hung and Cancel button did nothing) but can't on another (I get error message immediately).
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

First of all, those special names are reserved since ages:
MSDN wrote:Do not use the following reserved device names for the name of a file: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed by an extension, for example, NUL.tx7.
Windows NT: CLOCK$ is also a reserved device name.
In any case, this has been discussed in the past.
See e.g. here.

It's a Windows feature that you can do special things with such named files,
so I doubt that you would be able to distinguish actual valid targets from fake ones,
which is also what Christian stated in the past
TC plugins: PCREsearch and RegXtract
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

milo1012 wrote:First of all, those special names are reserved since ages:
Yepp, I know.

Code: Select all

copy con: t.bat<ENTER>
echo Hello World<ENTER>
pause<CONTROL^Z><ENTER>
t<ENTER>
Works even nowadays in TC :D

Regards
Holger
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed it's not a bug, just a Windows misfeature. I have personally used it to copy files to LPT1 (parallel printer).
Author of Total Commander
https://www.ghisler.com
Post Reply