summaryrefslogtreecommitdiffstats
path: root/src/pulse/context.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-13 22:15:52 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-13 22:15:52 +0100
commit21cbcc1a8a5900af9e820b10d5c1b28fc803f947 (patch)
tree18c6cf18e2f96a18cce20936799c3ec1f3e249df /src/pulse/context.c
parent3d6cc026e25ea3015ea989273ba69336a26ab686 (diff)
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.
Diffstat (limited to 'src/pulse/context.c')
-rw-r--r--src/pulse/context.c12
1 files changed, 7 insertions, 5 deletions
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 */