summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-26 13:18:22 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-26 13:21:50 +0900
commit93a683daad30bdf4440efaa0a1c5bffcb81f53ef (patch)
tree9a621e46d645459e4b303e2e4cc984a22f373f2d /src/lib/ecore_x
parente2093f788600e64fe17ee4d79d89e23e2127676c (diff)
evas and ecore_x shm segment management - fix over allocation and perms
so our sysv shm segments were both over-permissive (nothing bad really, just other users could read and write to/from our pixel data destined for the screen... they could do this to x11 directly anyway so no real issue), but be more restrictive and use 0600 as xserver runs as root so can read/write anyway and we only want our own uid access. but even more - fix our shm segment flushing to not keep lots of segments floating about like a bad smell when we don't need them. we had a cache but it wasnt flushed when it should be since async rendering turned up. this fixes that and we're back to agressively flushing them out when idle. @fix
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_image.c4
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_image.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_image.c b/src/lib/ecore_x/xcb/ecore_xcb_image.c
index 67a1470ffd..b6ac6ff4b0 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_image.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_image.c
@@ -621,7 +621,7 @@ _ecore_xcb_image_shm_check(void)
621 } 621 }
622 622
623 shminfo.shmid = 623 shminfo.shmid =
624 shmget(IPC_PRIVATE, img->stride * img->height, (IPC_CREAT | 0666)); 624 shmget(IPC_PRIVATE, img->stride * img->height, (IPC_CREAT | 0600));
625 if (shminfo.shmid == (uint32_t)-1) 625 if (shminfo.shmid == (uint32_t)-1)
626 { 626 {
627 xcb_image_destroy(img); 627 xcb_image_destroy(img);
@@ -675,7 +675,7 @@ _ecore_xcb_image_shm_create(Ecore_X_Image *im)
675 im->depth, NULL, ~0, NULL); 675 im->depth, NULL, ~0, NULL);
676 if (!im->xim) return; 676 if (!im->xim) return;
677 677
678 im->shminfo.shmid = shmget(IPC_PRIVATE, im->xim->size, (IPC_CREAT | 0666)); 678 im->shminfo.shmid = shmget(IPC_PRIVATE, im->xim->size, (IPC_CREAT | 0600));
679 if (im->shminfo.shmid == (uint32_t)-1) 679 if (im->shminfo.shmid == (uint32_t)-1)
680 { 680 {
681 xcb_image_destroy(im->xim); 681 xcb_image_destroy(im->xim);
diff --git a/src/lib/ecore_x/xlib/ecore_x_image.c b/src/lib/ecore_x/xlib/ecore_x_image.c
index 6dfe931d04..35ee976971 100644
--- a/src/lib/ecore_x/xlib/ecore_x_image.c
+++ b/src/lib/ecore_x/xlib/ecore_x_image.c
@@ -120,7 +120,7 @@ _ecore_x_image_shm_check(void)
120 } 120 }
121 121
122 shminfo.shmid = shmget(IPC_PRIVATE, xim->bytes_per_line * xim->height, 122 shminfo.shmid = shmget(IPC_PRIVATE, xim->bytes_per_line * xim->height,
123 IPC_CREAT | 0666); 123 IPC_CREAT | 0600);
124 if (shminfo.shmid == -1) 124 if (shminfo.shmid == -1)
125 { 125 {
126 ERR("%s", strerror(errno)); 126 ERR("%s", strerror(errno));
@@ -246,7 +246,7 @@ _ecore_x_image_shm_create(Ecore_X_Image *im)
246 246
247 im->shminfo.shmid = shmget(IPC_PRIVATE, 247 im->shminfo.shmid = shmget(IPC_PRIVATE,
248 im->xim->bytes_per_line * im->xim->height, 248 im->xim->bytes_per_line * im->xim->height,
249 IPC_CREAT | 0666); 249 IPC_CREAT | 0600);
250 if (im->shminfo.shmid == -1) 250 if (im->shminfo.shmid == -1)
251 { 251 {
252 ERR("shmget failed: %s", strerror(errno)); 252 ERR("shmget failed: %s", strerror(errno));