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
Branches
Tags
No related merge requests found
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
use strict; use strict;
use POSIX;
use lib '/usr/share/postgresql-common'; use lib '/usr/share/postgresql-common';
use PgCommon; use PgCommon;
...@@ -100,7 +102,8 @@ my $cmd = get_program_path ($cmdname, $version); ...@@ -100,7 +102,8 @@ my $cmd = get_program_path ($cmdname, $version);
# libreadline is a lot better than libedit, so prefer that # libreadline is a lot better than libedit, so prefer that
if ($cmdname eq 'psql') { if ($cmdname eq 'psql') {
my @readlines; 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.*>); push @readlines, sort(</lib/libreadline.so.*>);
if (@readlines) { if (@readlines) {
$ENV{'LD_PRELOAD'} = ($ENV{'LD_PRELOAD'} or '') . ':' . $readlines[-1]; $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