summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-07-27 08:23:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-08-03 08:35:36 (GMT)
commitd20602eec97caa8766820150eff2a07e205c44e1 (patch)
treefe4283d320ed15d4ba1015f6611f1d16ea563b26 /gitweb/gitweb.perl
parent6490a3383f1d0d96c122069e510ef1af1d019fbb (diff)
downloadgit-d20602eec97caa8766820150eff2a07e205c44e1.zip
git-d20602eec97caa8766820150eff2a07e205c44e1.tar.gz
git-d20602eec97caa8766820150eff2a07e205c44e1.tar.bz2
gitweb: do not choke on recursive symlink
If somebody used to advertise his repository that physically resides at /pub/lic.git/ as: git://git.example.com/pub/lic.git/ but now wants to use --base-path to allow: git://git.example.com/lic.git/ she can start git-daemon with --base-path option, like this: git-daemon --base-path=/pub --export-all During the transition, however, she would also want to allow older URL as well. One natural way to achieve that is to create a symlink: ln -s /pub /pub/pub so that a request to git://git.example.com/pub/lic.git/ is first translated by --base-path to a request to /pub/pub/lic.git/ which goes to /pub/lic.git, thanks to the symlink. So far so good. However, gitweb chokes if there is such a symlink (File::Find barfs with "/pub/pub is a recursive symbolic link"). Make the code ignore such a symlink. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.perl')
-rwxr-xr-xgitweb/gitweb.perl1
1 files changed, 1 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 498b936..077eb2f 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1515,6 +1515,7 @@ sub git_get_projects_list {
File::Find::find({
follow_fast => 1, # follow symbolic links
+ follow_skip => 2, # ignore duplicates
dangling_symlinks => 0, # ignore dangling symlinks, silently
wanted => sub {
# skip project-list toplevel, if we get it.