mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20:35:42 +02:00
bar/wayland: seal memfd
This commit is contained in:
parent
9a111a52f5
commit
7fbc1f2c44
1 changed files with 11 additions and 0 deletions
|
@ -937,6 +937,17 @@ get_buffer(struct wayland_backend *backend)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(MEMFD_CREATE)
|
||||||
|
/* Seal file - we no longer allow any kind of resizing */
|
||||||
|
/* TODO: wayland mmaps(PROT_WRITE), for some unknown reason, hence we cannot use F_SEAL_FUTURE_WRITE */
|
||||||
|
if (fcntl(pool_fd, F_ADD_SEALS,
|
||||||
|
F_SEAL_GROW | F_SEAL_SHRINK | /*F_SEAL_FUTURE_WRITE |*/ F_SEAL_SEAL) < 0)
|
||||||
|
{
|
||||||
|
LOG_ERRNO("failed to seal SHM backing memory file");
|
||||||
|
/* This is not a fatal error */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
pool = wl_shm_create_pool(backend->shm, pool_fd, size);
|
pool = wl_shm_create_pool(backend->shm, pool_fd, size);
|
||||||
if (pool == NULL) {
|
if (pool == NULL) {
|
||||||
LOG_ERR("failed to create SHM pool");
|
LOG_ERR("failed to create SHM pool");
|
||||||
|
|
Loading…
Add table
Reference in a new issue