Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 65E9D1539070 for ; Wed, 13 Jun 2012 12:53:07 -0300 (ADT) Received: from 30.55.colo.spiretech.net ([69.168.55.30] helo=lists.commandprompt.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SepsX-0005bs-HZ for pgsql-bugs@postgresql.org; Wed, 13 Jun 2012 15:53:06 +0000 Received: from perhan.alvh.no-ip.org (spinlock.commandprompt.com [69.168.55.30]) by lists.commandprompt.com (Postfix) with ESMTPA id 82A8722D; Wed, 13 Jun 2012 08:52:50 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.23.106] helo=perhan.alvh.no-ip.org) by assp.commandprompt.com with ESMTPS(AES256-SHA) (2.1.1); 13 Jun 2012 08:52:47 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9C2C96E3F9; Wed, 13 Jun 2012 11:52:44 -0400 (CLT) Content-Type: text/plain; charset=UTF-8 Cc: 'Edmund Horner' , Tom Lane , Pg Bugs , Bruce Momjian Subject: Re: 9.2 beta2 - pg_ctl crashes on Win32 when neither PGDATA nor -D specified From: Alvaro Herrera To: Amit Kapila In-reply-to: <002501cd4920$85617430$90245c90$@kapila@huawei.com> References: <9940.1339467780@sss.pgh.pa.us> <4fd73c8b.25d3440a.7d9b.7fd2SMTPIN_ADDED@mx.google.com> <002501cd4920$85617430$90245c90$@kapila@huawei.com> Date: Wed, 13 Jun 2012 11:52:44 -0400 Message-Id: <1339601668-sup-4658@alvh.no-ip.org> User-Agent: Sup/git X-Assp-Version: 2.1.1(11364) on assp.commandprompt.com X-Assp-Client-TLS: yes X-Assp-ID: assp.commandprompt.com m1-02770-02806 X-Assp-Envelope-From: alvherre@alvh.no-ip.org X-Assp-Intended-For: ejrh00@gmail.com X-Assp-Original-Subject: Re: [BUGS] 9.2 beta2 - pg_ctl crashes on Win32 when neither PGDATA nor -D specified Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/126 X-Sequence-Number: 33353 Excerpts from Amit Kapila's message of mi=C3=A9 jun 13 00:53:47 -0400 201= 2: > > 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. >=20 > I am doubtful whether we should make such an exception for -C option, a= s > this will > be a change in behavior as compare to previous versions.=20 > How to do in code is next step. > According to me the solution I have proposed is safer and already initd= b > handles in same way. >=20 > 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. --=20 =C3=81lvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support