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
This commit is contained in:
parent
49fefbde65
commit
2cacfa2932
@ -235,6 +235,10 @@ sp_writer_create (const char *path, size_t size, mode_t perms)
|
|||||||
|
|
||||||
self->socket_path = strdup (sock_un.sun_path);
|
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)
|
if (listen (self->main_socket, LISTEN_BACKLOG) < 0)
|
||||||
RETURN_ERROR ("listen() failed (%d): %s\n", errno, strerror (errno));
|
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)
|
for (area = self->shm_area; area; area = area->next)
|
||||||
ret |= fchmod (area->shm_fd, perms);
|
ret |= fchmod (area->shm_fd, perms);
|
||||||
|
|
||||||
|
ret |= chmod (self->socket_path, perms);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user