TC junction redirection behavior

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

TC junction redirection behavior

Post by *Lefteous »

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)
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3896
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Why is the behavior different? Are these different kind of junctions?
The only not ordinary behavior of junctions I have seen are the ones of MS fake folders such as "C:\Documents and Settings".
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
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Aren't some of the "junctions" in the C:\Users\FOO\*.* a weird amalgamation of Junction/Library? Others are junctions that you can't actually enter|view, "My Documents" - used to redirect old programs at the system level.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2MVV
Thanks! Any hints on how to detect these bastards programmatically without actually trying to enumerate them?
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.
Detecting the target isn't a problem for all junctions I encountared so far.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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. :)
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

Lefteous wrote:Any hints on how to detect these bastards programmatically without actually trying to enumerate them?
As sqa_wizard explained: "C:\Documents and Settings" etc. from Vista onwards are special.
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
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

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.
Last edited by Lefteous on 2015-08-17, 21:08 UTC, edited 1 time in total.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Wow, guys, English please. :)
Post Reply