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

Commiteeb6cb1

Browse files
committed
Add a boolean GUC parameter "bonjour" to control whether a Bonjour-enabled
build actually attempts to advertise itself via Bonjour. Formerly it alwaysdid so, which meant that packagers had to decide for their users whetherthis behavior was wanted or not. The default is "off" to be on the safeside, though this represents a change in the default behavior of aBonjour-enabled build. Per discussion.
1 parent59b9f3d commiteeb6cb1

File tree

5 files changed

+49
-7
lines changed

5 files changed

+49
-7
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.224 2009/08/24 20:08:31 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.225 2009/09/08 17:08:36 tgl Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -472,14 +472,28 @@ SET ENABLE_SEQSCAN TO OFF;
472472
</listitem>
473473
</varlistentry>
474474

475+
<varlistentry id="guc-bonjour" xreflabel="bonjour">
476+
<term><varname>bonjour</varname> (<type>boolean</type>)</term>
477+
<indexterm>
478+
<primary><varname>bonjour</> configuration parameter</primary>
479+
</indexterm>
480+
<listitem>
481+
<para>
482+
Enables advertising the server's existence via
483+
<productname>Bonjour</productname>. The default is off.
484+
This parameter can only be set at server start.
485+
</para>
486+
</listitem>
487+
</varlistentry>
488+
475489
<varlistentry id="guc-bonjour-name" xreflabel="bonjour_name">
476490
<term><varname>bonjour_name</varname> (<type>string</type>)</term>
477491
<indexterm>
478492
<primary><varname>bonjour_name</> configuration parameter</primary>
479493
</indexterm>
480494
<listitem>
481495
<para>
482-
Specifies the <productname>Bonjour</productname>broadcast
496+
Specifies the <productname>Bonjour</productname>service
483497
name. The computer name is used if this parameter is set to the
484498
empty string <literal>''</> (which is the default). This parameter is
485499
ignored if the server was not compiled with

‎src/backend/postmaster/postmaster.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.595 2009/09/0816:08:26 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.596 2009/09/0817:08:36 tgl Exp $
4141
*
4242
* NOTES
4343
*
@@ -200,6 +200,7 @@ boollog_hostname;/* for ps display and logging */
200200
boolLog_connections= false;
201201
boolDb_user_namespace= false;
202202

203+
boolenable_bonjour= false;
203204
char*bonjour_name;
204205

205206
/* PIDs of special child processes; 0 when not running */
@@ -854,7 +855,7 @@ PostmasterMain(int argc, char *argv[])
854855

855856
#ifdefUSE_BONJOUR
856857
/* Register for Bonjour only if we opened TCP socket(s) */
857-
if (ListenSocket[0]!=-1)
858+
if (enable_bonjour&&ListenSocket[0]!=-1)
858859
{
859860
DNSServiceErrorTypeerr;
860861

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

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.515 2009/09/03 22:08:05 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.516 2009/09/08 17:08:36 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -152,6 +152,7 @@ static bool assign_phony_autocommit(bool newval, bool doit, GucSource source);
152152
staticconstchar*assign_custom_variable_classes(constchar*newval,booldoit,
153153
GucSourcesource);
154154
staticboolassign_debug_assertions(boolnewval,booldoit,GucSourcesource);
155+
staticboolassign_bonjour(boolnewval,booldoit,GucSourcesource);
155156
staticboolassign_ssl(boolnewval,booldoit,GucSourcesource);
156157
staticboolassign_stage_log_stats(boolnewval,booldoit,GucSourcesource);
157158
staticboolassign_log_stats(boolnewval,booldoit,GucSourcesource);
@@ -681,6 +682,14 @@ static struct config_bool ConfigureNamesBool[] =
681682
&session_auth_is_superuser,
682683
false,NULL,NULL
683684
},
685+
{
686+
{"bonjour",PGC_POSTMASTER,CONN_AUTH_SETTINGS,
687+
gettext_noop("Enables advertising the server via Bonjour."),
688+
NULL
689+
},
690+
&enable_bonjour,
691+
false,assign_bonjour,NULL
692+
},
684693
{
685694
{"ssl",PGC_POSTMASTER,CONN_AUTH_SECURITY,
686695
gettext_noop("Enables SSL connections."),
@@ -2199,7 +2208,7 @@ static struct config_string ConfigureNamesString[] =
21992208

22002209
{
22012210
{"bonjour_name",PGC_POSTMASTER,CONN_AUTH_SETTINGS,
2202-
gettext_noop("Sets the Bonjourbroadcastservice name."),
2211+
gettext_noop("Sets the Bonjour service name."),
22032212
NULL
22042213
},
22052214
&bonjour_name,
@@ -7394,6 +7403,21 @@ assign_debug_assertions(bool newval, bool doit, GucSource source)
73947403
return true;
73957404
}
73967405

7406+
staticbool
7407+
assign_bonjour(boolnewval,booldoit,GucSourcesource)
7408+
{
7409+
#ifndefUSE_BONJOUR
7410+
if (newval)
7411+
{
7412+
ereport(GUC_complaint_elevel(source),
7413+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
7414+
errmsg("Bonjour is not supported by this build")));
7415+
return false;
7416+
}
7417+
#endif
7418+
return true;
7419+
}
7420+
73977421
staticbool
73987422
assign_ssl(boolnewval,booldoit,GucSourcesource)
73997423
{

‎src/backend/utils/misc/postgresql.conf.sample

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
#unix_socket_group = ''# (change requires restart)
7070
#unix_socket_permissions = 0777# begin with 0 to use octal notation
7171
# (change requires restart)
72+
#bonjour = off# advertise server via Bonjour
73+
# (change requires restart)
7274
#bonjour_name = ''# defaults to the computer name
7375
# (change requires restart)
7476

‎src/include/postmaster/postmaster.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/postmaster/postmaster.h,v 1.20 2009/05/05 19:59:00 tgl Exp $
9+
* $PostgreSQL: pgsql/src/include/postmaster/postmaster.h,v 1.21 2009/09/08 17:08:36 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -27,6 +27,7 @@ extern intPreAuthDelay;
2727
externintAuthenticationTimeout;
2828
externboolLog_connections;
2929
externboollog_hostname;
30+
externboolenable_bonjour;
3031
externchar*bonjour_name;
3132

3233
#ifdefWIN32

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp