Skip to content
Snippets Groups Projects
Commit 85aee149 authored by Martin Pitt's avatar Martin Pitt
Browse files

pg_wrapper: Restrict libreadline multiarch matching to native architecture

parent bd43d850
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,8 @@
use strict;
use POSIX;
use lib '/usr/share/postgresql-common';
use PgCommon;
......@@ -100,7 +102,8 @@ my $cmd = get_program_path ($cmdname, $version);
# libreadline is a lot better than libedit, so prefer that
if ($cmdname eq 'psql') {
my @readlines;
push @readlines, sort(</lib/*/libreadline.so.*>);
my $arch = (POSIX::uname)[4];
push @readlines, sort(</lib/$arch-*/libreadline.so.*>);
push @readlines, sort(</lib/libreadline.so.*>);
if (@readlines) {
$ENV{'LD_PRELOAD'} = ($ENV{'LD_PRELOAD'} or '') . ':' . $readlines[-1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment