*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.595 2009/09/08 16:08:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.596 2009/09/08 17:08:36 tgl Exp $
*
* NOTES
*
bool Log_connections = false;
bool Db_user_namespace = false;
+bool enable_bonjour = false;
char *bonjour_name;
/* PIDs of special child processes; 0 when not running */
#ifdef USE_BONJOUR
/* Register for Bonjour only if we opened TCP socket(s) */
- if (ListenSocket[0] != -1)
+ if (enable_bonjour && ListenSocket[0] != -1)
{
DNSServiceErrorType err;
* Written by Peter Eisentraut
.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.515 2009/09/03 22:08:05 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.516 2009/09/08 17:08:36 tgl Exp $
*
*--------------------------------------------------------------------
*/
static const char *assign_custom_variable_classes(const char *newval, bool doit,
GucSource source);
static bool assign_debug_assertions(bool newval, bool doit, GucSource source);
+static bool assign_bonjour(bool newval, bool doit, GucSource source);
static bool assign_ssl(bool newval, bool doit, GucSource source);
static bool assign_stage_log_stats(bool newval, bool doit, GucSource source);
static bool assign_log_stats(bool newval, bool doit, GucSource source);
&session_auth_is_superuser,
false, NULL, NULL
},
+ {
+ {"bonjour", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
+ gettext_noop("Enables advertising the server via Bonjour."),
+ NULL
+ },
+ &enable_bonjour,
+ false, assign_bonjour, NULL
+ },
{
{"ssl", PGC_POSTMASTER, CONN_AUTH_SECURITY,
gettext_noop("Enables SSL connections."),
{
{"bonjour_name", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
- gettext_noop("Sets the Bonjour broadcast service name."),
+ gettext_noop("Sets the Bonjour service name."),
NULL
},
&bonjour_name,
return true;
}
+static bool
+assign_bonjour(bool newval, bool doit, GucSource source)
+{
+#ifndef USE_BONJOUR
+ if (newval)
+ {
+ ereport(GUC_complaint_elevel(source),
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Bonjour is not supported by this build")));
+ return false;
+ }
+#endif
+ return true;
+}
+
static bool
assign_ssl(bool newval, bool doit, GucSource source)
{
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/postmaster/postmaster.h,v 1.20 2009/05/05 19:59:00 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/postmaster/postmaster.h,v 1.21 2009/09/08 17:08:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern int AuthenticationTimeout;
extern bool Log_connections;
extern bool log_hostname;
+extern bool enable_bonjour;
extern char *bonjour_name;
#ifdef WIN32