[BUG] Search doesn't detect infinite loops

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
ltm
Junior Member
Junior Member
Posts: 5
Joined: 2011-09-19, 20:21 UTC

[BUG] Search doesn't detect infinite loops

Post by *ltm »

I'm running 1.0 rc 1 on a Motorola Atrix 4G (Android 2.3.4). When searching from the file system root, the search is getting caught in an infinite loop caused by the "[face=courier]/osh/thumb2[/face] -> [face=courier]/osh[/face]" symlink. Since [face=courier]thumb2[/face] is a symlink to its own parent, the search will continue into [face=courier]/osh/thumb2[/face], [face=courier]/osh/thumb2/thumb2[/face], [face=courier]/osh/thumb2/thumb2/thumb2[/face], etc. The problem is described in the [face=courier]find(1)[/face] man page:
The POSIX standard requires that find detects loops:
The find utility shall detect infinite loops; that is, entering a previously visited directory that is an ancestor of the last file encountered. When it detects an infinite loop, find shall write a diagnostic message to standard error and shall either recover its position in the hierarchy or terminate.
I believe the [face=courier]/osh[/face] directory is part of the Atrix Webtop feature, so this problem may be specific to the Atrix. It should be possible to reproduce the problem on other phones using the following steps:
  1. [face=courier]$ adb -d shell[/face]
  2. [face=courier]$ cd /tmp[/face]
  3. [face=courier]$ ln -s . loop[/face]
  4. Launch Total Commander and navigate to /tmp
  5. Search for "loop"
The search results now include [face=courier]loop[/face], [face=courier]loop/loop[/face], [face=courier]loop/loop/loop[/face], etc.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately links are not reported to the Java interface, so they cannot be detected. If your phone is rooted, you can turn on root functions everywhere - then TC should NOT follow any links when searching.
Author of Total Commander
https://www.ghisler.com
Post Reply