TC junction redirection behavior
Moderators: Hacker, petermad, Stefan2, white
TC junction redirection behavior
When entering a junction in TC the contents of the target folder is displayed but the paths doesn't show the junction target.
For some junction points however the behavior is different. For example thre are some subfolders in the user folder which are actually junctions. When enttering them the path is the junction target.
Why is the behavior different? Are these different kind of junctions?
Some hints:
1) All tested junctions show the same type when listed in the DIR command
2) All junctions had the same attributes set (for testing purposes)
For some junction points however the behavior is different. For example thre are some subfolders in the user folder which are actually junctions. When enttering them the path is the junction target.
Why is the behavior different? Are these different kind of junctions?
Some hints:
1) All tested junctions show the same type when listed in the DIR command
2) All junctions had the same attributes set (for testing purposes)
These are special junctions with forbidden folder contents enumeration, TC just opens junction target in such case. Normal junctions make following them transparent so TC enters them like regular folders.
I have my NTLinks's real path field in all tooltips - it helps to detect any junctions and symlinks on the way.
I have my NTLinks's real path field in all tooltips - it helps to detect any junctions and symlinks on the way.
- sqa_wizard
- Power Member
- Posts: 3896
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
The only not ordinary behavior of junctions I have seen are the ones of MS fake folders such as "C:\Documents and Settings".Why is the behavior different? Are these different kind of junctions?
They are hidden to Windows Explorer, but visible to other programs.
MS did this due to compatibility purpose and created junction with old names to the new locations.
So far so good, but they did a little bit too much and finally got some recursive junctions.
Now you would get infinite sizes if you count the used disk space

So they decided to prohibit to enter those fake folders and take you magically to the real location.
Note: This is not a normal behavior of junctions, but forced by the MS operating system.
#5767 Personal license
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
2MVV
Thanks! Any hints on how to detect these bastards programmatically without actually trying to enumerate them?
Thanks! Any hints on how to detect these bastards programmatically without actually trying to enumerate them?
Detecting the target isn't a problem for all junctions I encountared so far.I have added to a tooltip for every file and folder my NTLinks's field showing real object path, it helps to detect any junctions and symlinks on the way.
Lefteous,
Why do you want to detect them? Do you have some problems with them? Until they don't allow enumerating contents, they can't cause infinite loops or slow search down, they only allow accessing objects using direct old-style path.
Balderstrom,
Libraries show contents of multiple folders in one place while junctions allow to access contents of one folder from multiple places.
Why do you want to detect them? Do you have some problems with them? Until they don't allow enumerating contents, they can't cause infinite loops or slow search down, they only allow accessing objects using direct old-style path.
Balderstrom,
Libraries show contents of multiple folders in one place while junctions allow to access contents of one folder from multiple places.

As sqa_wizard explained: "C:\Documents and Settings" etc. from Vista onwards are special.Lefteous wrote:Any hints on how to detect these bastards programmatically without actually trying to enumerate them?
From what I can see it's just a permission thing, so they may be detectable by checking if they only allow access to
the local built-in SYSTEM user or the local Administrators group.
See e.g. here and here.
I agree with MVV: there shouldn't be any enum problems.
You just have to live with the fact that they are pre-installed and permission pre-set by Windows.
TC plugins: PCREsearch and RegXtract
2milo1012
I guess you are right - it's done using permissions. I haven't checked it yet but it makes sense. At least it's not the usual Microsoft voodoo.
For me it's about if it's the right to display 'acces denied' like TC does. I still think this is quite confusing.
I guess you are right - it's done using permissions. I haven't checked it yet but it makes sense. At least it's not the usual Microsoft voodoo.
For me it's about if it's the right to display 'acces denied' like TC does. I still think this is quite confusing.
Last edited by Lefteous on 2015-08-17, 21:08 UTC, edited 1 time in total.