Re: Glitch in handling of postmaster -o options - Mailing list pgsql-hackers

From Marko Kreen
Subject Re: Glitch in handling of postmaster -o options
Date
Msg-id 20010930210459.B887@l-t.ee
Whole thread Raw
In response to Re: Glitch in handling of postmaster -o options  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Glitch in handling of postmaster -o options
List pgsql-hackers
On Sun, Sep 30, 2001 at 02:13:34PM -0400, Bruce Momjian wrote:
> > Marko Kreen <marko@l-t.ee> writes:
> > >> I wonder whether we should retire -o.
> > 
> > > How about putting -o stuff after -p?  That way only postmaster
> > > code can set PGC_POSTMASTER options for a backend, no way for
> > > user to mess up.  ATM this would break -o -F tho'.
> 
> Not sure what you are suggesting here.  Should we keep -o but say all
> options after -o are passed to postgres backends:

I am suggesting this.

Like previosly discussed, postmaster -F should be used instead
of postmaster '-o -F'.  Other options with PGC_BACKEND, like -S
keep on working.

-- 
marko


Index: src/backend/postmaster/postmaster.c
===================================================================
RCS file: /opt/cvs/pgsql/pgsql/src/backend/postmaster/postmaster.c,v
retrieving revision 1.243
diff -u -c -r1.243 postmaster.c
*** src/backend/postmaster/postmaster.c    21 Sep 2001 20:31:48 -0000    1.243
--- src/backend/postmaster/postmaster.c    30 Sep 2001 15:35:44 -0000
***************
*** 2035,2048 ****         av[ac++] = debugbuf;     } 
-     /*
-      * Pass any backend switches specified with -o in the postmaster's own
-      * command line.  We assume these are secure. (It's OK to mangle
-      * ExtraOptions since we are now in the child process; this won't
-      * change the postmaster's copy.)
-      */
-     split_opts(av, &ac, ExtraOptions);
-      /* Tell the backend what protocol the frontend is using. */     sprintf(protobuf, "-v%u", port->proto);
av[ac++]= protobuf;
 
--- 2035,2040 ----
***************
*** 2055,2060 ****
--- 2047,2062 ----      StrNCpy(dbbuf, port->database, ARGV_SIZE);     av[ac++] = dbbuf;
+ 
+     /*
+      * Pass any backend switches specified with -o in the postmaster's own
+      * command line.  (It's OK to mangle ExtraOptions since we are now in the
+      * child process; this won't change the postmaster's copy.)
+      *
+      * We dont assume anymore they are secure, now only PGC_BACKEND
+      * options can be specified that way.
+      */
+     split_opts(av, &ac, ExtraOptions);      /*      * Pass the (insecure) option switches from the connection
request.


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: path for contrib/intarray (current CVS)
Next
From: Bruce Momjian
Date:
Subject: Re: CVS changes