From ea4b63d8fff324d42463a653d8ab76ff9bc066c8 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 16 Nov 2020 15:42:44 +0000 Subject: [PATCH] main: set mode when creating shm object shm_open with O_CREAT uses mode for desired permissions. Linux ignores mode == 0 as unset but on FreeBSD shm object is created with no permissions to read and write. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index eaddd71cc..276218744 100644 --- a/main.c +++ b/main.c @@ -464,7 +464,7 @@ static struct wl_buffer *create_shm_buffer(struct wl_shm *shm, enum wl_shm_forma int size = stride * height; const char shm_name[] = "/swaylock-shm"; - int fd = shm_open(shm_name, O_RDWR | O_CREAT | O_EXCL, 0); + int fd = shm_open(shm_name, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); if (fd < 0) { fprintf(stderr, "shm_open failed\n"); return NULL;