Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4754dbf

Browse files
committed
Make GUC variables for syslog and SSL always visible
Make the variables visible (but not used) even whensupport is not compiled in.
1 parent3026027 commit4754dbf

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

‎src/backend/libpq/be-secure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ intssl_renegotiation_limit;
103103
#ifdefUSE_SSL
104104
staticSSL_CTX*SSL_context=NULL;
105105
staticboolssl_loaded_verify_locations= false;
106+
#endif
106107

107108
/* GUC variable controlling SSL cipher list */
108109
char*SSLCipherSuites=NULL;
109-
#endif
110110

111111
/* ------------------------------------------------------------ */
112112
/* Hardcoded values*/

‎src/backend/utils/misc/guc.c

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ extern char *temp_tablespaces;
128128
externboolsynchronize_seqscans;
129129
externboolfullPageWrites;
130130
externintssl_renegotiation_limit;
131+
externchar*SSLCipherSuites;
131132

132133
#ifdefTRACE_SORT
133134
externbooltrace_sort;
@@ -139,10 +140,6 @@ extern bool trace_syncscan;
139140
externbooloptimize_bounded_sort;
140141
#endif
141142

142-
#ifdefUSE_SSL
143-
externchar*SSLCipherSuites;
144-
#endif
145-
146143
staticvoidset_config_sourcefile(constchar*name,char*sourcefile,
147144
intsourceline);
148145

@@ -151,12 +148,14 @@ static const char *assign_log_destination(const char *value,
151148

152149
#ifdefHAVE_SYSLOG
153150
staticintsyslog_facility=LOG_LOCAL0;
151+
#else
152+
staticintsyslog_facility=0;
153+
#endif
154154

155155
staticboolassign_syslog_facility(intnewval,
156156
booldoit,GucSourcesource);
157157
staticconstchar*assign_syslog_ident(constchar*ident,
158158
booldoit,GucSourcesource);
159-
#endif
160159

161160
staticboolassign_session_replication_role(intnewval,booldoit,
162161
GucSourcesource);
@@ -280,8 +279,8 @@ static const struct config_enum_entry session_replication_role_options[] = {
280279
{NULL,0, false}
281280
};
282281

283-
#ifdefHAVE_SYSLOG
284282
staticconststructconfig_enum_entrysyslog_facility_options[]= {
283+
#ifdefHAVE_SYSLOG
285284
{"local0",LOG_LOCAL0, false},
286285
{"local1",LOG_LOCAL1, false},
287286
{"local2",LOG_LOCAL2, false},
@@ -290,9 +289,11 @@ static const struct config_enum_entry syslog_facility_options[] = {
290289
{"local5",LOG_LOCAL5, false},
291290
{"local6",LOG_LOCAL6, false},
292291
{"local7",LOG_LOCAL7, false},
292+
#else
293+
{"none",0, false},
294+
#endif
293295
{NULL,0}
294296
};
295-
#endif
296297

297298
staticconststructconfig_enum_entrytrack_function_options[]= {
298299
{"none",TRACK_FUNC_OFF, false},
@@ -410,9 +411,7 @@ inttcp_keepalives_count;
410411
*/
411412
staticchar*log_destination_string;
412413

413-
#ifdefHAVE_SYSLOG
414414
staticchar*syslog_ident_str;
415-
#endif
416415
staticboolphony_autocommit;
417416
staticboolsession_auth_is_superuser;
418417
staticdoublephony_random_seed;
@@ -2531,7 +2530,6 @@ static struct config_string ConfigureNamesString[] =
25312530
"postgresql-%Y-%m-%d_%H%M%S.log",NULL,NULL
25322531
},
25332532

2534-
#ifdefHAVE_SYSLOG
25352533
{
25362534
{"syslog_ident",PGC_SIGHUP,LOGGING_WHERE,
25372535
gettext_noop("Sets the program name used to identify PostgreSQL "
@@ -2541,7 +2539,6 @@ static struct config_string ConfigureNamesString[] =
25412539
&syslog_ident_str,
25422540
"postgres",assign_syslog_ident,NULL
25432541
},
2544-
#endif
25452542

25462543
{
25472544
{"TimeZone",PGC_USERSET,CLIENT_CONN_LOCALE,
@@ -2680,17 +2677,20 @@ static struct config_string ConfigureNamesString[] =
26802677
"pg_catalog.simple",assignTSCurrentConfig,NULL
26812678
},
26822679

2683-
#ifdefUSE_SSL
26842680
{
26852681
{"ssl_ciphers",PGC_POSTMASTER,CONN_AUTH_SECURITY,
26862682
gettext_noop("Sets the list of allowed SSL ciphers."),
26872683
NULL,
26882684
GUC_SUPERUSER_ONLY
26892685
},
26902686
&SSLCipherSuites,
2691-
"ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH",NULL,NULL
2687+
#ifdefUSE_SSL
2688+
"ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH",
2689+
#else
2690+
"none",
2691+
#endif
2692+
NULL,NULL
26922693
},
2693-
#endif/* USE_SSL */
26942694

26952695
{
26962696
{"application_name",PGC_USERSET,LOGGING_WHAT,
@@ -2807,16 +2807,19 @@ static struct config_enum ConfigureNamesEnum[] =
28072807
LOGSTMT_NONE,log_statement_options,NULL,NULL
28082808
},
28092809

2810-
#ifdefHAVE_SYSLOG
28112810
{
28122811
{"syslog_facility",PGC_SIGHUP,LOGGING_WHERE,
28132812
gettext_noop("Sets the syslog \"facility\" to be used when syslog enabled."),
28142813
NULL
28152814
},
28162815
&syslog_facility,
2817-
LOG_LOCAL0,syslog_facility_options,assign_syslog_facility,NULL
2818-
},
2816+
#ifdefHAVE_SYSLOG
2817+
LOG_LOCAL0,
2818+
#else
2819+
0,
28192820
#endif
2821+
syslog_facility_options,assign_syslog_facility,NULL
2822+
},
28202823

28212824
{
28222825
{"session_replication_role",PGC_SUSET,CLIENT_CONN_STATEMENT,
@@ -7637,27 +7640,30 @@ assign_log_destination(const char *value, bool doit, GucSource source)
76377640
returnvalue;
76387641
}
76397642

7640-
#ifdefHAVE_SYSLOG
7641-
76427643
staticbool
76437644
assign_syslog_facility(intnewval,booldoit,GucSourcesource)
76447645
{
7646+
#ifdefHAVE_SYSLOG
76457647
if (doit)
76467648
set_syslog_parameters(syslog_ident_str ?syslog_ident_str :"postgres",
76477649
newval);
7650+
#endif
7651+
/* Without syslog support, just ignore it */
76487652

76497653
return true;
76507654
}
76517655

76527656
staticconstchar*
76537657
assign_syslog_ident(constchar*ident,booldoit,GucSourcesource)
76547658
{
7659+
#ifdefHAVE_SYSLOG
76557660
if (doit)
76567661
set_syslog_parameters(ident,syslog_facility);
7662+
#endif
7663+
/* Without syslog support, it will always be set to "none", so ignore */
76577664

76587665
returnident;
76597666
}
7660-
#endif/* HAVE_SYSLOG */
76617667

76627668

76637669
staticbool

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp