[Lxr-dev] [ lxr-Bugs-745091 ] Infinite loop when indexing production source trees.
Brought to you by:
ajlittoz
From: SourceForge.net <no...@so...> - 2003-05-28 18:47:40
|
Bugs item #745091, was opened at 2003-05-28 14:47 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=745091&group_id=27350 Category: genxref Group: None Status: Open Resolution: None Priority: 5 Submitted By: Richard Munroe (munroe_r) Assigned to: Nobody/Anonymous (nobody) Summary: Infinite loop when indexing production source trees. Initial Comment: I generally index my development source trees. When the linux kernel is built, a link from linux to /usr/src/linux is established. Which in many cases causes genxref to go into an infinite loop processing subdirectories. I've patched my version of lxr so that LXR::Files::Plain won't chase directory links (it WILL chase regular file links) which is good enough for my site. Probably a better fix would be to check for links that go outside the currently indexed directory structure and not process stuff that goes outside that or above it in the same directory tree. Anyway, here's the patch: --- /usr/src/lxr-0.9.2/lib/LXR/Files/Plain.pm Tue Feb 26 10:57:55 2002 +++ Plain.pm Wed May 28 14:10:13 2003 @@ -103,6 +103,12 @@ $dir = $self->toreal($pathname, $release); opendir(DIR, $dir) || die ("Can't open $dir"); while (defined($node = readdir(DIR))) { + # + # Avoid chasing links of directories. Using LXR on a production + # source tree results in infinite loops due to the creation + # of a link to linux. + # + next if ((-d "$dir/$node") && (-l "$dir/$node")) ; next if $node =~ /^\.|~$|\.orig$/; next if $node eq 'CVS'; Dick Munroe (mu...@cs...) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=745091&group_id=27350 |