Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

we need infinite recursion detection or option to skip NTFS Junctions/symlinks for folders #30

Open
R-Adrian opened this issue May 9, 2017 · 9 comments

Comments

@R-Adrian
Copy link

R-Adrian commented May 9, 2017

on modern Windows systems some folder paths from %USERPROFILE% are actually NTFS junction points to other folders under the same tree root...

this causes an infinite loop situation that is only broken when the constructed the file path name exceeds the maximum possible path length (256-ish characters)

for example:
%USERPROFILE%\Local Settings is actually a NTFS Junction to %USERPROFILE%\AppData\Local

in this folder we have another junction... and this is where the problem starts:
%USERPROFILE%\AppData\Local\Application Data is a NTFS junction that points back to ... %USERPROFILE%\AppData\Local
(yes.. a junction that points back to the parent of the junction... blame Microsoft.)
My OS here is Windows 10 1703, fully updated but the same OS behaviour is present on Windows 7 too.

Please add an option to skip NTFS Junctions/symlinks or add some recursive path loop detection logic when creating/verifying checksums.

I think an option to skip NTFS Junctions and NTFS symlinks (for folders only) would be much simpler.

@R-Adrian R-Adrian changed the title we need infinite recursion detection or option to skip NTFS Junctions/symlinks we need infinite recursion detection or option to skip NTFS Junctions/symlinks for folders May 9, 2017
@ZPNRG
Copy link

ZPNRG commented May 10, 2017

I haven't encountered this problem, but am using Windows 10 v1703 (latest build). I echo that this potential issue should be addressed in some form.

@R-Adrian
Copy link
Author

R-Adrian commented May 11, 2017

even Win 10 1703 has this... it's done by design by Microsoft for compatibility with older programs that expect a different structure of the user profile folder.

please check the user profile folder on your computer and try to create a recursive checksum file for it.

HashCheck will "find" a lot more files than there are actually on disk because it follows NTFS folder junctions and symlinks.

@surfasb
Copy link

surfasb commented Jul 7, 2017

I think it should skip NTFS junctions and Symlink folders by default.

@JohnLGalt
Copy link

Having the option to allow / disallow following junctions would be most beneficial, IMO, with the caveat that by default it is disallowed.

@R-Adrian
Copy link
Author

R-Adrian commented Jul 29, 2019

update: i have noticed that Microsoft has introduced a new group policy for Win10 in recent years that significantly alters the maximum possible file path length:

gpedit.msc -> computer -> administrative templates -> system -> filesystem -> Enable Win32 long paths

this policy, if enabled, coupled with HashCheck's bug of blindly traversing paths recursively means that the recursion depth is increased by a few orders of magnitude.... basically it becomes an (almost) never-ending loop (not quite infinite, but high enough to feel like an infinite loop)

image

@JohnLGalt
Copy link

Yummy. As if my ancient system doesn't have enough issues.

Seriously, though, I just cleanly installed 1903, and then joined the Insider Program and took the Skip Ahead build 18945 - and that setting is currently set to Not configured.

But it can be enabled - and with near disastrous effects with HC also installed.

@RchGrav
Copy link

RchGrav commented Sep 7, 2019

Junctions should probably be skipped in general unless you override and force to follow them.. Why would you want to follow junctions when there is an actual folder taking you in most cases.. junctions are sometimes (typically?) for compatibility w/ previous (legacy) paths for compatibility.. For example, the \Users[username]\AppData\Local\Application Data\ folder links back to \Users[username]\AppData\Local\ <- This example is also recursing.

@JohnLGalt
Copy link

JohnLGalt commented Sep 8, 2019

Well, I don't like accessing things like .ISOs in folders that are several layers down the chain - so I have those locations that I use often (for example, the folders where I store newly created Windows 10 Insider Preview .ISOs from UUPDUMP.ml) junctioned back to a single F:\ISOs\ folder for easy access.

As the contents of the folder F:\Storage\ISOs\OSs\Windows\10\ changes on a nearly weekly basis....

Yes, I know - I'm the exception to the rule - but as you can probably bet, those (and other files in a similar situation, whose parent folder I've junctioned to a shallow location) are also exactly the files that I will need to verify hashes on.....

@superbonaci
Copy link

There are soft and hard links, and also shared folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants