summaryrefslogtreecommitdiff
path: root/sys/shm
diff options
context:
space:
mode:
authorRoland Elek <relek.f2@gmail.com>2013-01-07 13:32:06 +0100
committerOlivier CrĂȘte <olivier.crete@collabora.com>2013-01-17 19:16:42 -0500
commit2cacfa293214a2c840cfe422ae7a6f3c0c77e69b (patch)
treed26351574a87603073b1e72cda94c10c670aaffb /sys/shm
parent49fefbde655b9e78c6f64279d68e74ea4ddafce3 (diff)
downloadgstreamer-plugins-bad-2cacfa293214a2c840cfe422ae7a6f3c0c77e69b.tar.gz
shm: apply shm area permissions to shmpipe control socket
Apply shared memory area permissions to the control socket (more precisely, the path it is bound to) as well. https://bugzilla.gnome.org/show_bug.cgi?id=682775
Diffstat (limited to 'sys/shm')
-rw-r--r--sys/shm/shmpipe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/shm/shmpipe.c b/sys/shm/shmpipe.c
index 4da027b72..e1863edc4 100644
--- a/sys/shm/shmpipe.c
+++ b/sys/shm/shmpipe.c
@@ -235,6 +235,10 @@ sp_writer_create (const char *path, size_t size, mode_t perms)
self->socket_path = strdup (sock_un.sun_path);
+ if (chmod (self->socket_path, perms) < 0)
+ RETURN_ERROR ("failed to set socket permissions (%d): %s\n", errno,
+ strerror (errno));
+
if (listen (self->main_socket, LISTEN_BACKLOG) < 0)
RETURN_ERROR ("listen() failed (%d): %s\n", errno, strerror (errno));
@@ -445,6 +449,8 @@ sp_writer_setperms_shm (ShmPipe * self, mode_t perms)
for (area = self->shm_area; area; area = area->next)
ret |= fchmod (area->shm_fd, perms);
+ ret |= chmod (self->socket_path, perms);
+
return ret;
}