Suggestion: Warn for delete with junctions

English support forum

Moderators: Stefan2, white, sheep, Hacker

Post Reply
isidro
Junior Member
Junior Member
Posts: 64
Joined: 2006-03-21, 04:39 UTC
Location: argentina

Suggestion: Warn for delete with junctions

Post by *isidro » 2019-01-17, 14:05 UTC

Ruined a windows installation once when trying to delete the Windows.Old folder because it had wrong junctions to outside active windows folders (ie: "C:\Windows.Old\Archivos de Programa" pointed to "C:\Program Files" instead of the inner " "C:\Windows.Old\Program Files"). Total Commander started deleting files outside the intended target.
An extra warning should be showed whenever deleting (and maybe when moving) files that are placed outside selected target...

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

Re: Suggestion: Warn for delete with junctions

Post by *ghisler(Author) » 2019-01-17, 16:05 UTC

Total Commander does not follow junctions when deleting, it just deletes the junctions themselves.
Author of Total Commander
http://www.ghisler.com

User avatar
Horst.Epp
Power Member
Power Member
Posts: 3373
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Suggestion: Warn for delete with junctions

Post by *Horst.Epp » 2019-01-17, 17:17 UTC

isidro wrote:
2019-01-17, 14:05 UTC
Ruined a windows installation once when trying to delete the Windows.Old folder because it had wrong junctions to outside active windows folders (ie: "C:\Windows.Old\Archivos de Programa" pointed to "C:\Program Files" instead of the inner " "C:\Windows.Old\Program Files"). Total Commander started deleting files outside the intended target.
An extra warning should be showed whenever deleting (and maybe when moving) files that are placed outside selected target...
The Windows Cleanmgr.exe is responsible for deleting Windows.old.
Using this tool is the normal way to delete old Windows installations.
But I did it once in the past with TC and it didn't destroy anything outside of it.
Windows 10 Home x64 May 2019 Update, Version 1903 (OS Build 18362.295)
Intel(R) Core(TM) i7-4770 CPU @ 3.40GH, 16GB RAM
TC 9.22a x64 and x86, Everything 1.4.1.947 (x64)

User avatar
MVV
Power Member
Power Member
Posts: 8282
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Suggestion: Warn for delete with junctions

Post by *MVV » 2019-01-18, 07:46 UTC

I've tried to delete a folder with a junction in it when the folder requires admin rights, but TC 9.21a for some reason was unable to delete it via 'As Administrator' button... When I've deleted the junction manually via the same 'As Administrator' button, TC could remove the folder.
Last edited by MVV on 2019-01-22, 06:52 UTC, edited 1 time in total.

isidro
Junior Member
Junior Member
Posts: 64
Joined: 2006-03-21, 04:39 UTC
Location: argentina

Re: Suggestion: Warn for delete with junctions

Post by *isidro » 2019-01-19, 14:19 UTC

So I don't know how or what happened then. Maybe it was coincidence. Thanks.

isidro
Junior Member
Junior Member
Posts: 64
Joined: 2006-03-21, 04:39 UTC
Location: argentina

Re: Suggestion: Warn for delete with junctions

Post by *isidro » 2019-01-23, 17:46 UTC

Been able to reproduce HUGE issue, when entering on a HD (to fix) "G:\Users\All Users" it actually takes you to local HD: "C:\ProgramData", but windows title states you are on "g:\Users\All Users\" so anything one deletes there it's being deleted on C: drive instead of G:
I think in that way I might destroyed a working OS.

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

Re: Suggestion: Warn for delete with junctions

Post by *ghisler(Author) » 2019-01-24, 10:41 UTC

This can happen when the hard link (junction / Reparse point) only allows to be opened / followed, but the target name cannot be read. Then TC cannot know where it points.
Author of Total Commander
http://www.ghisler.com

User avatar
MVV
Power Member
Power Member
Posts: 8282
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Suggestion: Warn for delete with junctions

Post by *MVV » 2019-01-25, 09:46 UTC

ghisler(Author) wrote:
2019-01-24, 10:41 UTC
This can happen when the hard link (junction / Reparse point) only allows to be opened / followed, but the target name cannot be read. Then TC cannot know where it points.
Why does TC remove anything behind a reparse point if it is being able to detect that it is a reparse point? It just should never delete anything behind any reparse point, but just delete the reparse point itself.

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

Re: Suggestion: Warn for delete with junctions

Post by *ghisler(Author) » 2019-01-28, 14:53 UTC

Why does TC remove anything behind a reparse point if it is being able to detect that it is a reparse point?
It doesn't, except if it doesn't detect that it is a reparse point.
Author of Total Commander
http://www.ghisler.com

User avatar
MVV
Power Member
Power Member
Posts: 8282
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Suggestion: Warn for delete with junctions

Post by *MVV » 2019-01-28, 15:02 UTC

Ok, but I think that such items should be non-listable, correct? If a folder can be listed in dir, its reparse point flag may be get via WIN32_FIND_DATA structure.

Post Reply