Re: authentication/t/001_password.pl trashes ~/.psql_history - Mailing list pgsql-hackers

From Tom Lane
Subject Re: authentication/t/001_password.pl trashes ~/.psql_history
Date
Msg-id 1306174.1703350376@sss.pgh.pa.us
Whole thread Raw
In response to Re: authentication/t/001_password.pl trashes ~/.psql_history  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: authentication/t/001_password.pl trashes ~/.psql_history
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> On 2023-12-22 Fr 17:11, Tom Lane wrote:
>> After studying this some more, my conclusion is that BackgroundPsql.pm
>> failed to borrow as much as it should have from 010_tab_completion.pl.
>> Specifically, we want all the environment-variable changes that that
>> script performed to be applied in any test using an interactive psql.
>> Maybe ~/.inputrc and so forth would never affect any other test scripts,
>> but that doesn't seem like a great bet.

> Looks fine, after reading your original post I was thinking along the 
> same lines.

Thanks for reviewing.

> You could shorten this
> +    my $history_file = $params{history_file};
> +    $history_file ||= '/dev/null';
> +    $ENV{PSQL_HISTORY} = $history_file;
> to just
>       $ENV{PSQL_HISTORY} = $params{history_file} || '/dev/null';

OK.  I was unsure which way would be considered more readable,
but based on your advice I shortened it.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Password leakage avoidance
Next
From: "Andrey M. Borodin"
Date:
Subject: Re: Transaction timeout