pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Subject: Re: Proposed patch for key managment
Date: Sun, 6 Dec 2020 23:42:23 -0500
Message-ID: <20201207044223.GA12952@momjian.us> (raw)
In-Reply-To: <CA+fd4k4hzZPU6Zq0g+8XXsA6fhk0mJvRzzbALHepPGkPdMDD0Q@mail.gmail.com>
References: <20201202213814.GG20285@momjian.us>
	<20201205020803.GA8757@momjian.us>
	<CA+fd4k7eHyvqU8FbDTcK_GV0Qc6+QyJCoaFF9dHipJSG9pWmcQ@mail.gmail.com>
	<20201205035229.GC8757@momjian.us>
	<X8uDCWWf9BlBFa/B@paquier.xyz>
	<20201205154205.GA31727@momjian.us>
	<CA+fd4k4hzZPU6Zq0g+8XXsA6fhk0mJvRzzbALHepPGkPdMDD0Q@mail.gmail.com>

On Mon, Dec  7, 2020 at 09:30:03AM +0900, Masahiko Sawada wrote:
> Thank you for updating the patch!
> 
> I think we need explicit_bzero() also in freeing the keywrap context.

pg_cryptohash_free() already has this:

    explicit_bzero(state, sizeof(pg_cryptohash_state));
    explicit_bzero(ctx, sizeof(pg_cryptohash_ctx));

Do we need more?

> BTW, when we need -R option pg_ctl command to start the server, how
> can we start it in the single-user mode?

I added code for that, but I hadn't tested it yet.  Now that I tried it,
I realized that it is awkward to supply a file descriptor number (that
will be closed) from the command-line, so I added code and docs to allow
-1 to duplicate standard error, and it worked:

	$ postgres --single -R -1 -D /u/pg/data
	
	Enter password:
	PostgreSQL stand-alone backend 14devel
	backend> select 100;
	         1: ?column?    (typeid = 23, len = 4, typmod = -1, byval = t)
	        ----
	         1: ?column? = "100"    (typeid = 23, len = 4, typmod = -1, byval = t)
	        ----

Updated patch at the same URL:

	https://github.com/postgres/postgres/compare/master...bmomjian:key.diff

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee






view thread (93+ messages)  latest in thread

Message-ID: <20201207044223.GA12952@momjian.us>
Permalink:  ../20201207044223.GA12952@momjian.us/
Also on:    postgresql.org/message-id/20201207044223.GA12952@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: bruce@momjian.us, masahiko.sawada@2ndquadrant.com, michael@paquier.xyz, sawada.mshk@gmail.com
  Subject: Re: Proposed patch for key managment
  In-Reply-To: <20201207044223.GA12952@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox