Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YObyF-0000na-UP for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Feb 2015 01:01:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YObyF-0006mh-Dm for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Feb 2015 01:01:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YObyE-0006mb-O2 for pgsql-bugs@postgresql.org; Fri, 20 Feb 2015 01:01:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YObyB-0007rc-Qy for pgsql-bugs@postgresql.org; Fri, 20 Feb 2015 01:01:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t1K11QE0019898; Thu, 19 Feb 2015 20:01:26 -0500 From: Tom Lane To: dannyman@toldme.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12788: host / peer auth works after pg_ctl reload, then blocks server startup In-reply-to: <20150219174414.8727.12447@wrigleys.postgresql.org> References: <20150219174414.8727.12447@wrigleys.postgresql.org> Comments: In-reply-to dannyman@toldme.com message dated "Thu, 19 Feb 2015 17:44:14 +0000" Date: Thu, 19 Feb 2015 20:01:26 -0500 Message-ID: <19897.1424394086@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org dannyman@toldme.com writes: > I naively added a line like this to pg_hba.conf: > host all postgres x.x.x.x/32 peer > I ran pg_ctl reload. "pg_ctl reload" unfortunately has no way to detect whether the reload succeeded. Had you checked in the postmaster log you'd likely have found some bleating to the effect that the reload didn't take. > I was then able to connect from x.x.x.x to do backups. If so, it must have been due to some previously existing entry. > I then restarted the server, and it failed, with this error: > LOG: peer authentication is only supported on local sockets Yup ... > I can see why pg_ctl reload might gloss over a config issue instead of > bringing down the server, but that the invalid auth configuration then works > strokes me as a bug. It didn't "work". Making the postmaster keep running despite the attempt to load a bad file has been generally agreed to be the best thing, but it does mean that if you don't pay attention to the effects of a reload, you can shoot yourself in the foot like this :-(. AFAICS the only thing we could do to make this significantly safer would be to restrict use of "pg_ctl reload" to scenarios wherein pg_ctl could determine whether the postmaster had reloaded its config without any complaints. Unfortunately, that would be a pretty draconian restriction, so there's no free lunch here. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs