From 21cbcc1a8a5900af9e820b10d5c1b28fc803f947 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 13 Jan 2010 22:15:52 +0100 Subject: client: introduce auto-connect-display= following the scheme of auto-connect-localhost= Just connecting to a PA server just because X11's $DISPLAY is set might be a security hole. --- src/pulse/context.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/pulse/context.c') diff --git a/src/pulse/context.c b/src/pulse/context.c index 85b90ac7..83e0dbb5 100644 --- a/src/pulse/context.c +++ b/src/pulse/context.c @@ -987,13 +987,15 @@ int pa_context_connect( /* Prepend in reverse order */ /* Follow the X display */ - if ((d = getenv("DISPLAY"))) { - d = pa_xstrndup(d, strcspn(d, ":")); + if (c->conf->auto_connect_display) { + if ((d = getenv("DISPLAY"))) { + d = pa_xstrndup(d, strcspn(d, ":")); - if (*d) - c->server_list = pa_strlist_prepend(c->server_list, d); + if (*d) + c->server_list = pa_strlist_prepend(c->server_list, d); - pa_xfree(d); + pa_xfree(d); + } } /* Add TCP/IP on the localhost */ -- cgit