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

[Feature Request] Option to disable resolving symlinks #125

Open
Hate9 opened this issue Sep 4, 2022 · 4 comments
Open

[Feature Request] Option to disable resolving symlinks #125

Hate9 opened this issue Sep 4, 2022 · 4 comments

Comments

@Hate9
Copy link

Hate9 commented Sep 4, 2022

I've been trying to recover some files, but unfortunately, somewhere in the directory I'm trying to recover, there's a symbolic link to the root directory, which means that any file recovery attempts just fill up with repeat copies of the same files, over and over again, without getting to the things I actually care about.

In theory, it should be very easy to fix this, by just turning off the feature that resolves symbolic links, but there doesn't appear to be an option to do that anywhere.

It would do me a great deal of good if someone could implement this, or if that's too much trouble, possibly inform me on where I'd want to look to disable the feature in a local build.
Or, I've just missed the option to disable it, in which case I greatly appreciate you pointing out where it is, and I apologize for wasting your time lol

@cgsecurity
Copy link
Owner

I am unable to reproduce the problem. Do you have the problem with latest 7.2-WIP version ?
Symlinks are ignored by Testdisk. There is also some code to prevent infinite loop when parsing directories.

I have tried with the following disk image

├── dir1
│   ├── dir2
│   │   ├── file2
│   │   ├── symlink_dir1 -> ../../dir1/
│   │   ├── symlink_dir3 -> ../dir3
│   │   ├── symlink_parent -> ..
│   │   └── symlink_root -> /
│   ├── dir3
│   │   └── file3
│   ├── file1
│   ├── symlink_parent -> ..
│   └── symlink_root -> /
├── lost+found
└── symlink_root -> /

Using testdisk to copy everything, the destination contains

.
├── dir1
│   ├── dir2
│   │   └── file2
│   ├── dir3
│   │   └── file3
│   └── file1
└── lost+found

@Hate9
Copy link
Author

Hate9 commented Sep 5, 2022

I have not tried it with the latest version (this was a little while ago); I'll have to do that.

@Hate9
Copy link
Author

Hate9 commented Sep 15, 2022

no, it's definitely still doing it.

@Hate9
Copy link
Author

Hate9 commented Sep 26, 2022

I recovered some files (and stopped at some point, because it was looping again), and here's the result of tree on the dir. You can see that it recurses at line 1597, where it enters the home directory again.

files.txt

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

2 participants