
The article says that all tests were successful (i.e.

Finally, it turns out that many Linux-based forensic Live CDs are not tested properly and there are no suitable test cases published.Īnother side of the problem of insufficient testing of forensic Live CDs is that many users do not know what happens "under the hood" of the provided operating system and cannot adequately test them.įor example, Forensic Cop Journal (Volume 1(3), Oct 2009) describes a test case when an Ext3 file system was mounted using "-o ro" mount flag as a way to write protect the data. Unfortunately, community-developed distributions are no exception here. Currently, many vendors of such Live CD distributions spread false claims that their distributions "do not touch anything", "write protect everything" and so on. 3.5.1 rebuildfstab and scanpartitions scriptsįorensic Live CDs are widely used during computer forensic investigations.One tree in the 'forest' then the above should be fine. That a given node may be shared among two or more trees, the aboveĪlgorithm will not work properly. Your output data structure looks like it contains a 'forest' of trees. The SentinalNode is a marker that you use to detect looping ' Queue contains only orphans or is empty Queue(SentinalNode) ' marker to identify cycle through queue The above algorithm becomes: set NodeProcessed to False The only thing you should have to do is add a sentinal node to the back of the queueĪnd a flag to indicate that at least one node was consumed from the queueĭuring one complete cycle through it. Where AddNodeToTree is a function that takes a node, successfullyĪdds it to the output and returns True. If not AddNodeToTree(node) then Queue(node) 'add to the back I imagine your algorithim looks something like Do While not QueueEmpty() Unless there are nodes where the 'parent' does not exist (orphans). IfĪ node cannot be added to the output (because its 'parent' has notīeen moved to the output data structure yet) Inserted into your output data structure they are dropped from the queue. Of data structure to store unprocessed nodes. Looks like you are using a queue (remove from the front, add to the back) kind ($this->push() is a method that tries to find a parent and, if it succeeds, inserts $item into its hierarchy)

This is the important bit: $cnt = count($array) I suppose I should be able to realize that I'm cycling the same items over and over again?

For the record, when in the loop I realize there's no parent to insert the item into, I push the item at the end of the array because the parent might exists down the line. I bet there's a way to tell when I've fallen into the infinite loop. The problem I have is that if one of the records has an invalid parent reference, it cannot be put in the hierarchy and the script ends in an infinite loop, trying to find the parent. There is no limit on how deep the nesting can go. I select all, store them in an array, then iterate over them and create a nested array in memory. I have a hierarchy of nodes stored in DB.
