@@ -128,6 +128,7 @@ extern char *temp_tablespaces;
128
128
extern bool synchronize_seqscans ;
129
129
extern bool fullPageWrites ;
130
130
extern int ssl_renegotiation_limit ;
131
+ extern char * SSLCipherSuites ;
131
132
132
133
#ifdef TRACE_SORT
133
134
extern bool trace_sort ;
@@ -139,10 +140,6 @@ extern bool trace_syncscan;
139
140
extern bool optimize_bounded_sort ;
140
141
#endif
141
142
142
- #ifdef USE_SSL
143
- extern char * SSLCipherSuites ;
144
- #endif
145
-
146
143
static void set_config_sourcefile (const char * name , char * sourcefile ,
147
144
int sourceline );
148
145
@@ -151,12 +148,14 @@ static const char *assign_log_destination(const char *value,
151
148
152
149
#ifdef HAVE_SYSLOG
153
150
static int syslog_facility = LOG_LOCAL0 ;
151
+ #else
152
+ static int syslog_facility = 0 ;
153
+ #endif
154
154
155
155
static bool assign_syslog_facility (int newval ,
156
156
bool doit , GucSource source );
157
157
static const char * assign_syslog_ident (const char * ident ,
158
158
bool doit , GucSource source );
159
- #endif
160
159
161
160
static bool assign_session_replication_role (int newval , bool doit ,
162
161
GucSource source );
@@ -280,8 +279,8 @@ static const struct config_enum_entry session_replication_role_options[] = {
280
279
{NULL , 0 , false}
281
280
};
282
281
283
- #ifdef HAVE_SYSLOG
284
282
static const struct config_enum_entry syslog_facility_options [] = {
283
+ #ifdef HAVE_SYSLOG
285
284
{"local0" , LOG_LOCAL0 , false},
286
285
{"local1" , LOG_LOCAL1 , false},
287
286
{"local2" , LOG_LOCAL2 , false},
@@ -290,9 +289,11 @@ static const struct config_enum_entry syslog_facility_options[] = {
290
289
{"local5" , LOG_LOCAL5 , false},
291
290
{"local6" , LOG_LOCAL6 , false},
292
291
{"local7" , LOG_LOCAL7 , false},
292
+ #else
293
+ {"none" , 0 , false},
294
+ #endif
293
295
{NULL , 0 }
294
296
};
295
- #endif
296
297
297
298
static const struct config_enum_entry track_function_options [] = {
298
299
{"none" , TRACK_FUNC_OFF , false},
@@ -410,9 +411,7 @@ int tcp_keepalives_count;
410
411
*/
411
412
static char * log_destination_string ;
412
413
413
- #ifdef HAVE_SYSLOG
414
414
static char * syslog_ident_str ;
415
- #endif
416
415
static bool phony_autocommit ;
417
416
static bool session_auth_is_superuser ;
418
417
static double phony_random_seed ;
@@ -2531,7 +2530,6 @@ static struct config_string ConfigureNamesString[] =
2531
2530
"postgresql-%Y-%m-%d_%H%M%S.log" , NULL , NULL
2532
2531
},
2533
2532
2534
- #ifdef HAVE_SYSLOG
2535
2533
{
2536
2534
{"syslog_ident" , PGC_SIGHUP , LOGGING_WHERE ,
2537
2535
gettext_noop ("Sets the program name used to identify PostgreSQL "
@@ -2541,7 +2539,6 @@ static struct config_string ConfigureNamesString[] =
2541
2539
& syslog_ident_str ,
2542
2540
"postgres" , assign_syslog_ident , NULL
2543
2541
},
2544
- #endif
2545
2542
2546
2543
{
2547
2544
{"TimeZone" , PGC_USERSET , CLIENT_CONN_LOCALE ,
@@ -2680,17 +2677,20 @@ static struct config_string ConfigureNamesString[] =
2680
2677
"pg_catalog.simple" , assignTSCurrentConfig , NULL
2681
2678
},
2682
2679
2683
- #ifdef USE_SSL
2684
2680
{
2685
2681
{"ssl_ciphers" , PGC_POSTMASTER , CONN_AUTH_SECURITY ,
2686
2682
gettext_noop ("Sets the list of allowed SSL ciphers." ),
2687
2683
NULL ,
2688
2684
GUC_SUPERUSER_ONLY
2689
2685
},
2690
2686
& SSLCipherSuites ,
2691
- "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH" , NULL , NULL
2687
+ #ifdef USE_SSL
2688
+ "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH" ,
2689
+ #else
2690
+ "none" ,
2691
+ #endif
2692
+ NULL , NULL
2692
2693
},
2693
- #endif /* USE_SSL */
2694
2694
2695
2695
{
2696
2696
{"application_name" , PGC_USERSET , LOGGING_WHAT ,
@@ -2807,16 +2807,19 @@ static struct config_enum ConfigureNamesEnum[] =
2807
2807
LOGSTMT_NONE , log_statement_options , NULL , NULL
2808
2808
},
2809
2809
2810
- #ifdef HAVE_SYSLOG
2811
2810
{
2812
2811
{"syslog_facility" , PGC_SIGHUP , LOGGING_WHERE ,
2813
2812
gettext_noop ("Sets the syslog \"facility\" to be used when syslog enabled." ),
2814
2813
NULL
2815
2814
},
2816
2815
& syslog_facility ,
2817
- LOG_LOCAL0 , syslog_facility_options , assign_syslog_facility , NULL
2818
- },
2816
+ #ifdef HAVE_SYSLOG
2817
+ LOG_LOCAL0 ,
2818
+ #else
2819
+ 0 ,
2819
2820
#endif
2821
+ syslog_facility_options , assign_syslog_facility , NULL
2822
+ },
2820
2823
2821
2824
{
2822
2825
{"session_replication_role" , PGC_SUSET , CLIENT_CONN_STATEMENT ,
@@ -7637,27 +7640,30 @@ assign_log_destination(const char *value, bool doit, GucSource source)
7637
7640
return value ;
7638
7641
}
7639
7642
7640
- #ifdef HAVE_SYSLOG
7641
-
7642
7643
static bool
7643
7644
assign_syslog_facility (int newval , bool doit , GucSource source )
7644
7645
{
7646
+ #ifdef HAVE_SYSLOG
7645
7647
if (doit )
7646
7648
set_syslog_parameters (syslog_ident_str ? syslog_ident_str : "postgres" ,
7647
7649
newval );
7650
+ #endif
7651
+ /* Without syslog support, just ignore it */
7648
7652
7649
7653
return true;
7650
7654
}
7651
7655
7652
7656
static const char *
7653
7657
assign_syslog_ident (const char * ident , bool doit , GucSource source )
7654
7658
{
7659
+ #ifdef HAVE_SYSLOG
7655
7660
if (doit )
7656
7661
set_syslog_parameters (ident , syslog_facility );
7662
+ #endif
7663
+ /* Without syslog support, it will always be set to "none", so ignore */
7657
7664
7658
7665
return ident ;
7659
7666
}
7660
- #endif /* HAVE_SYSLOG */
7661
7667
7662
7668
7663
7669
static bool
0 commit comments