TC tries to open .tab files as archive with packer plugin

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

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

TC tries to open .tab files as archive with packer plugin

Post by *Dalai »

Hi there.

Up until HolgerK's post in the thread C# How to make Total Commander execute a command? I didn't know that TC can open .tab files specified on command line. Since this didn't work with my regular wincmd.ini, but it did with a fresh wincmd.ini I tried to find out what the culprit is.

And I had success. In my case it's a packer plugin for STALKER archive files.

The bug:
When the plugin is registered like this:

Code: Select all

db0=448,%COMMANDER_PATH%\Plugins\stalker\stalker.wcx
and you try to start TC with some .tab file, e.g.

Code: Select all

[activetabs]
0_path=C:\Windows\
0_options=1|0|0|0|0|0|0|
1_path=C:\Windows\
1_options=1|0|0|0|0|0|0|
activetab=1
[inactivetabs]
0_path=C:\Windows\
0_options=1|0|0|0|0|0|0|||10001
1_path=C:\Windows\
1_options=1|0|0|0|0|0|0|||10001
activetab=1
specified on command line like this:

Code: Select all

TOTALCMD.EXE e:\a.tab
results in TC's error message

Code: Select all

---------------------------
Total Commander
---------------------------
Error in packed file E:\a.tab!
---------------------------
OK   
---------------------------
Replacing the 448 with 384 - i.e. removing the ability to detect archive type by content - solves the issue.

Expected behavior: TC should open the tabs given in the .tab file instead of trying to open the file as an archive.

I tried to reproduce this with other packer plugins (7zip, img/ima, chm), but had no luck. So it seems it depends also on the packer plugin itself. Either way, for me it's a TC bug, because it shouldn't even try to use any packer plugin for the .tab file (why should it?).

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
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Dalai,
for me it's a TC bug, because it shouldn't even try to use any packer plugin for the .tab file (why should it?)
Because a .tab file might be an archive?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2Hacker
TC can try to open .tab files as an archive, but not the one specified as TC command line parameter. Yes, sure, there might be archives with this extension. Maybe it's better to introduce another command line switch (like /TF, for tab file) that takes the .tab file as argument. But I already know what Ghisler is going to say about such a suggestion ;).

Regards
Dalai
Last edited by Dalai on 2018-01-04, 23:02 UTC, edited 1 time in total.
#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
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Dalai,
Does /A help?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Nope. /A was the first thing I tried. It only prevents that TC tries to open the .tab file as archive, but it doesn't open the saved tabs either...

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
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC accepts also archives via command line. They take precedence over .tab files. If a plugin indicates that it supports the format, TC will therefore pass the file to the plugin.

I can add a function where the tab file is handled internally if all the packer plugin calls fail.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Maybe TC could check if the .tab file supplied via command line is a (valid) TC .tab file and if it is, skip the packer plugins altogether. In other words: Lower the priority given to packer plugins in this specific case (.tab files). However, I don't know if this would be more complex and/or complicated to check, so it's up to you to decide which way is the best one.

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
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

They are just text files in .ini format, which may be used by plugins too...
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

ghisler(Author) wrote:They are just text files in .ini format, which may be used by plugins too...
Uh, used by packer plugins? I think the probability for this is very very small. And, as I said, TC could only skip the packer plugins if it's a valid .tab file that was specified via command line. This suggestion doesn't apply to a running TC where packer plugins should get the priority of course.

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
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

For example, the diskdir plugin uses text files to store just names, sizes and timestamps of files/folders.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This should be fixed in TC 9.20 beta 1, please test it!
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

After figuring out how I reproduced this bug (I definitely have too many machines ;)), I can now confirm that I'm not able to reproduce it on TC 9.20 beta1. So I can confirm this bugfix:

Code: Select all

23.03.18 Fixed: Command line parameters: Always treat file with extension .tab as a directory tab file, even when a packer plugin claims the extension for itself (32/64)
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
Post Reply