about summary refs log tree commit homepage
path: root/lib/PublicInbox/Admin.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-21 07:51:20 +0000
committerEric Wong <e@80x24.org>2020-12-21 21:51:57 +0000
commit3e9888ed30b7fe092b03789d19a8020d4bc0fb39 (patch)
treefcdb2a81886f3526ddaa09c674eea308310bef6b /lib/PublicInbox/Admin.pm
parentbad84119fb0915abe3f19fe4fb9c34e24fe7e564 (diff)
downloadpublic-inbox-3e9888ed30b7fe092b03789d19a8020d4bc0fb39.tar.gz
We need to canonicalize paths for inboxes which do not have
a newsgroup defined, otherwise ->eidx_key matches can fail
in unexpected ways.
Diffstat (limited to 'lib/PublicInbox/Admin.pm')
-rw-r--r--lib/PublicInbox/Admin.pm11
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/PublicInbox/Admin.pm b/lib/PublicInbox/Admin.pm
index ea82133a..c972fb68 100644
--- a/lib/PublicInbox/Admin.pm
+++ b/lib/PublicInbox/Admin.pm
@@ -10,7 +10,7 @@ our @EXPORT_OK = qw(setup_signals);
 use PublicInbox::Config;
 use PublicInbox::Inbox;
 use PublicInbox::Spawn qw(popen_rd);
-use File::Spec ();
+*rel2abs_collapsed = \&PublicInbox::Config::rel2abs_collapsed;
 
 sub setup_signals {
         my ($cb, $arg) = @_; # optional
@@ -27,15 +27,6 @@ sub setup_signals {
         };
 }
 
-# abs_path resolves symlinks, so we want to avoid it if rel2abs
-# is sufficient and doesn't leave "/.." or "/../"
-sub rel2abs_collapsed ($) {
-        my $p = File::Spec->rel2abs($_[0]);
-        return $p if substr($p, -3, 3) ne '/..' && index($p, '/../') < 0; # likely
-        require Cwd;
-        Cwd::abs_path($p);
-}
-
 sub resolve_inboxdir {
         my ($cd, $ver) = @_;
         my $try = $cd // '.';