Re: fix for new SUSET GUC variables - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: fix for new SUSET GUC variables
Date
Msg-id 200307091758.h69HwlC09728@candle.pha.pa.us
Whole thread Raw
In response to Re: fix for new SUSET GUC variables  (Aizaz Ahmed <aahmed@redhat.com>)
List pgsql-patches
Good catch.  That help file didn't exist when I wrote the original
patch.

Both fixes you mentioned are attached and applied.

---------------------------------------------------------------------------

Aizaz Ahmed wrote:
> On Wed, 2003-07-09 at 02:50, Bruce Momjian wrote:
> > I have applied this patch, which I posted previously.
> >
> > It adds a new GUC context USERLIMIT which prevents certain options from
> > being turned off or increased, for security.  This fixes problems with
> > making some options SUSET.
>
> > ***************
> > *** 57,62 ****
> > --- 60,66 ----
> >        PGC_SIGHUP,
> >        PGC_BACKEND,
> >        PGC_SUSET,
> >+       PGC_USERLIMIT,
> >        PGC_USERSET
> >  } GucContext;
>
>
> I believe when updating the GucContext enum, it is also necessary to
> update the GucContext_names [] in backend/utils/misc/help_config.c.
>
> The need to do this was supposed to be added as a comment to the guc.h
> file, right about where GucContext is defined, but it seems as if that
> part of the patch was not applied.
>
> >From the original patch "Patch for listing runtime option details
> through server executable (pg_guc)", dated "30 Jun 2003 16:43:13 -0400":
>
>
> Index: src/include/utils/guc.h
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/include/utils/guc.h,v
> retrieving revision 1.32
> diff -c -p -r1.32 guc.h
> *** src/include/utils/guc.h     11 Jun 2003 18:01:14 -0000      1.32
> --- src/include/utils/guc.h     30 Jun 2003 19:18:44 -0000
> ***************
> *** 50,55 ****
> --- 50,60 ----
>    *
>    * USERSET options can be set by anyone any time.
>    */
> +
> + /*
> +  * When updating the GucContexts, please make sure to update the
> corresponding
> +  * GucContext_names [] entries in pg_guc.c. The two must correspond
> +  */
>   typedef enum
>   {
>         PGC_INTERNAL,
>
>
> This patch was modified before being applied ... was there a reason that
> this part of the patch was not applied? One of the modifications made
> when applying the patch was to change the names of some of the files ...
> in the above excerpt pg_guc.c would have to change to help_config.c.
>
> Thanks,
> Aizaz
>
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/backend/utils/misc/help_config.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/utils/misc/help_config.c,v
retrieving revision 1.1
diff -c -c -r1.1 help_config.c
*** src/backend/utils/misc/help_config.c    4 Jul 2003 16:41:21 -0000    1.1
--- src/backend/utils/misc/help_config.c    9 Jul 2003 17:56:29 -0000
***************
*** 143,148 ****
--- 143,149 ----
      "SIGHUP",
      "BACKEND",
      "SUSET",
+     "USERLIMIT",
      "USERSET"
  };

Index: src/include/utils/guc.h
===================================================================
RCS file: /cvsroot/pgsql-server/src/include/utils/guc.h,v
retrieving revision 1.33
diff -c -c -r1.33 guc.h
*** src/include/utils/guc.h    9 Jul 2003 06:47:34 -0000    1.33
--- src/include/utils/guc.h    9 Jul 2003 17:56:30 -0000
***************
*** 52,57 ****
--- 52,60 ----
   * non-super users.
   *
   * USERSET options can be set by anyone any time.
+  *
+  * When updating the GucContexts, please make sure to update the
+  * corresponding GucContext_names [] entries in pg_guc.c.
   */
  typedef enum
  {

pgsql-patches by date:

Previous
From: Weiping He
Date:
Subject: typo in src/include/utils/array.h
Next
From: Philip Yarra
Date:
Subject: Fwd: Re: [HACKERS] OSF build fixed