pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Amit Kapila <amit.kapila@huawei.com>
Cc: Edmund Horner <ejrh00@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Cc: Bruce Momjian <bruce@momjian.us>
Subject: Re: 9.2 beta2 - pg_ctl crashes on Win32 when neither PGDATA nor -D specified
Date: Wed, 13 Jun 2012 11:52:44 -0400
Message-ID: <1339601668-sup-4658@alvh.no-ip.org> (raw)
In-Reply-To: <002501cd4920$85617430$90245c90$@kapila@huawei.com>
References: <CAMyN-kAsMj18rV9eshn4JX4Dn-JXbLMzC+eZ6wrnQ76FavaFfA@mail.gmail.com>
	<9940.1339467780@sss.pgh.pa.us>
	<4fd73c8b.25d3440a.7d9b.7fd2SMTPIN_ADDED@mx.google.com>
	<CAMyN-kCJ0RVmrhsT3ipqOmRh=E-E=RuHNWob-iO2HChLUjFeYQ@mail.gmail.com>
	<002501cd4920$85617430$90245c90$@kapila@huawei.com>


Excerpts from Amit Kapila's message of mié jun 13 00:53:47 -0400 2012:
> > Unfortunately in src/backend/main/main.c it only does a cursory check
> > for --help and --version.  So it would need to become a little more
> > complicated to scan for -C options at that stage.  It's not too much
> > if you can assume -C always appears first like the other special
> > options detected in that file.
> 
> I am doubtful whether we should make such an exception for -C option, as
> this will
> be a change in behavior as compare to previous versions. 
> How to do in code is next step.
> According to me the solution I have proposed is safer and already initdb
> handles in same way.
> 
> I am waiting for other people opinion on this issue.

I agree with you.  The fact that we drop privileges is not only a
security measure; it's a robustness one as well.  With the current
setup, we can confidently say "it's not Postgres' fault" when the system
crashes with some weird kernel error.  A process running with
administrative privs is capable of doing privileged stuff that may
override safe interfaces provided by the operating system; a process
without admin privs is more constrained and should not be able to cause
the system to crash.  Any kernel crash, then, is not our responsibility.
If we allow -C to run with admin privs, we lose that.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (13+ messages)  latest in thread

Message-ID: <1339601668-sup-4658@alvh.no-ip.org>
Permalink:  ../1339601668-sup-4658@alvh.no-ip.org/
Also on:    postgresql.org/message-id/1339601668-sup-4658@alvh.no-ip.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@commandprompt.com, amit.kapila@huawei.com, ejrh00@gmail.com, tgl@sss.pgh.pa.us, bruce@momjian.us
  Subject: Re: 9.2 beta2 - pg_ctl crashes on Win32 when neither PGDATA nor -D specified
  In-Reply-To: <1339601668-sup-4658@alvh.no-ip.org>
  References: <CAMyN-kAsMj18rV9eshn4JX4Dn-JXbLMzC+eZ6wrnQ76FavaFfA@mail.gmail.com> <9940.1339467780@sss.pgh.pa.us> <4fd73c8b.25d3440a.7d9b.7fd2SMTPIN_ADDED@mx.google.com> <CAMyN-kCJ0RVmrhsT3ipqOmRh=E-E=RuHNWob-iO2HChLUjFeYQ@mail.gmail.com> <002501cd4920$85617430$90245c90$@kapila@huawei.com> <1339601668-sup-4658@alvh.no-ip.org>

* 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