srbchannel: Introduce per-client SHM files

The PA daemon currently uses a single SHM file for all clients
sending and receiving commands over the low-latency srbchannel
mechanism.

To avoid leaks between clients in that case, and to provide the
necessary ground work later for sandboxing and memfds, create the
srbchannel SHM files on a per-client basis.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
This commit is contained in:
Ahmed S. Darwish 2016-03-13 00:53:34 +02:00 committed by David Henningsson
parent 9bda6e344a
commit 211a520543
3 changed files with 27 additions and 17 deletions

View file

@ -126,11 +126,6 @@ pa_core* pa_core_new(pa_mainloop_api *m, bool shared, size_t shm_size) {
c->shm_size = shm_size;
pa_silence_cache_init(&c->silence_cache);
if (shared && !(c->rw_mempool = pa_mempool_new(shared, shm_size)))
pa_log_warn("Failed to allocate shared writable memory pool.");
if (c->rw_mempool)
pa_mempool_set_is_remote_writable(c->rw_mempool, true);
c->exit_event = NULL;
c->scache_auto_unload_event = NULL;
@ -217,8 +212,6 @@ static void core_free(pa_object *o) {
pa_assert(!c->default_sink);
pa_silence_cache_done(&c->silence_cache);
if (c->rw_mempool)
pa_mempool_unref(c->rw_mempool);
pa_mempool_unref(c->mempool);
for (j = 0; j < PA_CORE_HOOK_MAX; j++)
@ -284,9 +277,6 @@ void pa_core_maybe_vacuum(pa_core *c) {
}
pa_mempool_vacuum(c->mempool);
if (c->rw_mempool)
pa_mempool_vacuum(c->rw_mempool);
}
pa_time_event* pa_core_rttime_new(pa_core *c, pa_usec_t usec, pa_time_event_cb_t cb, void *userdata) {