~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/backend/utils/misc/guc-file.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-06-14 09:53:29 UTC
  • mto: (6.1.1 sid) (10.1.1 oneiric-proposed) (1.2.1)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20110614095329-71gfhjywyp2c27au
Tags: upstream-9.1~beta2
ImportĀ upstreamĀ versionĀ 9.1~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
529
529
#include <ctype.h>
530
530
#include <unistd.h>
531
531
 
 
532
#include "mb/pg_wchar.h"
532
533
#include "miscadmin.h"
533
534
#include "storage/fd.h"
534
535
#include "utils/guc.h"
558
559
static char *GUC_scanstr(const char *s);
559
560
 
560
561
#define YY_NO_INPUT 1
561
 
#line 562 "guc-file.c"
 
562
#line 563 "guc-file.c"
562
563
 
563
564
#define INITIAL 0
564
565
 
738
739
        register char *yy_cp, *yy_bp;
739
740
        register int yy_act;
740
741
    
741
 
#line 76 "guc-file.l"
742
 
 
743
 
 
744
 
#line 745 "guc-file.c"
 
742
#line 77 "guc-file.l"
 
743
 
 
744
 
 
745
#line 746 "guc-file.c"
745
746
 
746
747
        if ( !(yy_init) )
747
748
                {
823
824
case 1:
824
825
/* rule 1 can match eol */
825
826
YY_RULE_SETUP
826
 
#line 78 "guc-file.l"
 
827
#line 79 "guc-file.l"
827
828
ConfigFileLineno++; return GUC_EOL;
828
829
        YY_BREAK
829
830
case 2:
830
831
YY_RULE_SETUP
831
 
#line 79 "guc-file.l"
 
832
#line 80 "guc-file.l"
832
833
/* eat whitespace */
833
834
        YY_BREAK
834
835
case 3:
835
836
YY_RULE_SETUP
836
 
#line 80 "guc-file.l"
 
837
#line 81 "guc-file.l"
837
838
/* eat comment (.* matches anything until newline) */
838
839
        YY_BREAK
839
840
case 4:
840
841
YY_RULE_SETUP
841
 
#line 82 "guc-file.l"
 
842
#line 83 "guc-file.l"
842
843
return GUC_ID;
843
844
        YY_BREAK
844
845
case 5:
845
846
YY_RULE_SETUP
846
 
#line 83 "guc-file.l"
 
847
#line 84 "guc-file.l"
847
848
return GUC_QUALIFIED_ID;
848
849
        YY_BREAK
849
850
case 6:
850
851
YY_RULE_SETUP
851
 
#line 84 "guc-file.l"
 
852
#line 85 "guc-file.l"
852
853
return GUC_STRING;
853
854
        YY_BREAK
854
855
case 7:
855
856
YY_RULE_SETUP
856
 
#line 85 "guc-file.l"
 
857
#line 86 "guc-file.l"
857
858
return GUC_UNQUOTED_STRING;
858
859
        YY_BREAK
859
860
case 8:
860
861
YY_RULE_SETUP
861
 
#line 86 "guc-file.l"
 
862
#line 87 "guc-file.l"
862
863
return GUC_INTEGER;
863
864
        YY_BREAK
864
865
case 9:
865
866
YY_RULE_SETUP
866
 
#line 87 "guc-file.l"
 
867
#line 88 "guc-file.l"
867
868
return GUC_REAL;
868
869
        YY_BREAK
869
870
case 10:
870
871
YY_RULE_SETUP
871
 
#line 88 "guc-file.l"
 
872
#line 89 "guc-file.l"
872
873
return GUC_EQUALS;
873
874
        YY_BREAK
874
875
case 11:
875
876
YY_RULE_SETUP
876
 
#line 90 "guc-file.l"
 
877
#line 91 "guc-file.l"
877
878
return GUC_ERROR;
878
879
        YY_BREAK
879
880
case 12:
880
881
YY_RULE_SETUP
881
 
#line 92 "guc-file.l"
 
882
#line 93 "guc-file.l"
882
883
YY_FATAL_ERROR( "flex scanner jammed" );
883
884
        YY_BREAK
884
 
#line 885 "guc-file.c"
 
885
#line 886 "guc-file.c"
885
886
case YY_STATE_EOF(INITIAL):
886
887
        yyterminate();
887
888
 
1839
1840
 
1840
1841
#define YYTABLES_NAME "yytables"
1841
1842
 
1842
 
#line 92 "guc-file.l"
 
1843
#line 93 "guc-file.l"
1843
1844
 
1844
1845
 
1845
1846
 
1861
1862
                                   *tail;
1862
1863
        char       *cvc = NULL;
1863
1864
        struct config_string *cvc_struct;
1864
 
        const char *envvar;
1865
1865
        int                     i;
1866
1866
 
1867
1867
        Assert(context == PGC_POSTMASTER || context == PGC_SIGHUP);
2017
2017
                                stack->source = PGC_S_DEFAULT;
2018
2018
                }
2019
2019
 
2020
 
                /* Now we can re-apply the wired-in default */
 
2020
                /* Now we can re-apply the wired-in default (i.e., the boot_val) */
2021
2021
                set_config_option(gconf->name, NULL, context, PGC_S_DEFAULT,
2022
2022
                                                  GUC_ACTION_SET, true);
2023
2023
                if (context == PGC_SIGHUP)
2027
2027
        }
2028
2028
 
2029
2029
        /*
2030
 
         * Restore any variables determined by environment variables.  This
2031
 
         * is a no-op except in the case where one of these had been in the
2032
 
         * config file and is now removed.  PGC_S_ENV_VAR will override the
2033
 
         * wired-in default we just applied, but cannot override any other source.
2034
 
         *
2035
 
         * Keep this list in sync with InitializeGUCOptions()!
2036
 
         * PGPORT can be ignored, because it cannot be changed without restart.
2037
 
         * We assume rlimit hasn't changed, either.
 
2030
         * Restore any variables determined by environment variables or
 
2031
         * dynamically-computed defaults.  This is a no-op except in the case
 
2032
         * where one of these had been in the config file and is now removed.
 
2033
         *
 
2034
         * In particular, we *must not* do this during the postmaster's
 
2035
         * initial loading of the file, since the timezone functions in
 
2036
         * particular should be run only after initialization is complete.
 
2037
         *
 
2038
         * XXX this is an unmaintainable crock, because we have to know how
 
2039
         * to set (or at least what to call to set) every variable that could
 
2040
         * potentially have PGC_S_DYNAMIC_DEFAULT or PGC_S_ENV_VAR source.
 
2041
         * However, there's no time to redesign it for 9.1.
2038
2042
         */
2039
 
        envvar = getenv("PGDATESTYLE");
2040
 
        if (envvar != NULL)
2041
 
                set_config_option("datestyle", envvar, PGC_POSTMASTER,
2042
 
                                                  PGC_S_ENV_VAR, GUC_ACTION_SET, true);
2043
 
 
2044
 
        envvar = getenv("PGCLIENTENCODING");
2045
 
        if (envvar != NULL)
2046
 
                set_config_option("client_encoding", envvar, PGC_POSTMASTER,
2047
 
                                                  PGC_S_ENV_VAR, GUC_ACTION_SET, true);
2048
 
 
 
2043
        if (context == PGC_SIGHUP)
 
2044
        {
 
2045
                InitializeGUCOptionsFromEnvironment();
 
2046
                pg_timezone_initialize();
 
2047
                pg_timezone_abbrev_initialize();
 
2048
                /* this selects SQL_ASCII in processes not connected to a database */
 
2049
                SetConfigOption("client_encoding", GetDatabaseEncodingName(),
 
2050
                                                PGC_BACKEND, PGC_S_DYNAMIC_DEFAULT);
 
2051
        }
2049
2052
 
2050
2053
        /* If we got here all the options checked out okay, so apply them. */
2051
2054
        for (item = head; item; item = item->next)