Re: Glitch in handling of postmaster -o options

From: Marko Kreen <marko(at)l-t(dot)ee>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Glitch in handling of postmaster -o options
Date: 2001-09-30 19:05:00
Message-ID: 20010930210459.B887@l-t.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 30, 2001 at 02:13:34PM -0400, Bruce Momjian wrote:
> > Marko Kreen <marko(at)l-t(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-09-30 19:57:53 Re: CVS changes
Previous Message Bruce Momjian 2001-09-30 18:26:36 Re: path for contrib/intarray (current CVS)