pgsql: Fix saving and restoring umask

Started by Peter Eisentrautalmost 9 years ago3 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Fix saving and restoring umask

In two cases, we set a different umask for some piece of code and
restore it afterwards. But if the contained code errors out, the umask
is not restored. So add TRY/CATCH blocks to fix that.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/aa6b7b72d9bcf967cbccd378de4bc5cef33d02f9

Modified Files
--------------
src/backend/commands/copy.c | 11 ++++++++++-
src/backend/libpq/be-fsstubs.c | 13 +++++++++++--
2 files changed, 21 insertions(+), 3 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: pgsql: Fix saving and restoring umask

Peter Eisentraut <peter_e@gmx.net> writes:

Fix saving and restoring umask
In two cases, we set a different umask for some piece of code and
restore it afterwards. But if the contained code errors out, the umask
is not restored. So add TRY/CATCH blocks to fix that.

Doesn't that need to be back-patched?

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#2)
Re: pgsql: Fix saving and restoring umask

On 9/22/17 17:48, Tom Lane wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

Fix saving and restoring umask
In two cases, we set a different umask for some piece of code and
restore it afterwards. But if the contained code errors out, the umask
is not restored. So add TRY/CATCH blocks to fix that.

Doesn't that need to be back-patched?

done

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers