[PATCH] client: unset WAYLAND_SOCKET env variable

Kristian Høgsberg krh at bitplanet.net
Mon Dec 5 06:54:06 PST 2011


On Mon, Dec 5, 2011 at 3:04 AM, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> WAYLAND_SOCKET contains a file descriptor that is an open connection to
> a Wayland server. It is private to us, and makes no sense to relay the
> same value (or any value) to our child processes.
>
> Unset the environment variable to prevent it from being accidentally
> relayed to other processes.

Indeed, looks good.
Kristian

> Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
> ---
>  src/wayland-client.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/src/wayland-client.c b/src/wayland-client.c
> index 939c17d..22244f8 100644
> --- a/src/wayland-client.c
> +++ b/src/wayland-client.c
> @@ -352,6 +352,7 @@ wl_display_connect(const char *name)
>                flags = fcntl(display->fd, F_GETFD);
>                if (flags != -1)
>                        fcntl(display->fd, F_SETFD, flags | FD_CLOEXEC);
> +               unsetenv("WAYLAND_SOCKET");
>        } else if (connect_to_socket(display, name) < 0) {
>                free(display);
>                return NULL;
> --
> 1.7.3.4
>


More information about the wayland-devel mailing list