[MPlayer-cvslog] r38419 - in trunk: gui/wm/ws.c libvo/vo_x11.c libvo/vo_xv.c libvo/vo_xvmc.c

ib subversion at mplayerhq.hu
Sun Apr 23 01:58:53 EEST 2023


Author: ib
Date: Sun Apr 23 01:58:52 2023
New Revision: 38419

Log:
Use appropriate shared memory permissions.

An umask setting does not affect the permissions assigned to
System V IPC objects created by the process using shmget().

Original patch by Vladimir D. Seleznev, vseleznv altlinux org,
slightly modified by committer.

Reported by Wladmis, dev wladmis org.

Modified:
   trunk/gui/wm/ws.c
   trunk/libvo/vo_x11.c
   trunk/libvo/vo_xv.c
   trunk/libvo/vo_xvmc.c

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Wed Apr 19 22:50:12 2023	(r38418)
+++ trunk/gui/wm/ws.c	Sun Apr 23 01:58:52 2023	(r38419)
@@ -1357,7 +1357,7 @@ void wsImageCreate(wsWindow *win, int w,
             mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
         }
 
-        win->Shminfo.shmid = shmget(IPC_PRIVATE, win->xImage->bytes_per_line * win->xImage->height, IPC_CREAT | 0777);
+        win->Shminfo.shmid = shmget(IPC_PRIVATE, win->xImage->bytes_per_line * win->xImage->height, IPC_CREAT | SHM_R | SHM_W);
 
         if (win->Shminfo.shmid < 0) {
             XDestroyImage(win->xImage);

Modified: trunk/libvo/vo_x11.c
==============================================================================
--- trunk/libvo/vo_x11.c	Wed Apr 19 22:50:12 2023	(r38418)
+++ trunk/libvo/vo_x11.c	Sun Apr 23 01:58:52 2023	(r38419)
@@ -150,7 +150,7 @@ static void getMyXImage(void)
         }
         Shminfo[0].shmid = shmget(IPC_PRIVATE,
                                   myximage->bytes_per_line *
-                                  myximage->height, IPC_CREAT | 0777);
+                                  myximage->height, IPC_CREAT | SHM_R | SHM_W);
         if (Shminfo[0].shmid < 0)
         {
             XDestroyImage(myximage);

Modified: trunk/libvo/vo_xv.c
==============================================================================
--- trunk/libvo/vo_xv.c	Wed Apr 19 22:50:12 2023	(r38418)
+++ trunk/libvo/vo_xv.c	Sun Apr 23 01:58:52 2023	(r38419)
@@ -279,7 +279,7 @@ static void allocate_xvimage(int foo)
                                          &Shminfo[foo]);
 
         Shminfo[foo].shmid =
-            shmget(IPC_PRIVATE, xvimage[foo]->data_size, IPC_CREAT | 0777);
+            shmget(IPC_PRIVATE, xvimage[foo]->data_size, IPC_CREAT | SHM_R | SHM_W);
         Shminfo[foo].shmaddr = (char *) shmat(Shminfo[foo].shmid, 0, 0);
         Shminfo[foo].readOnly = False;
 

Modified: trunk/libvo/vo_xvmc.c
==============================================================================
--- trunk/libvo/vo_xvmc.c	Wed Apr 19 22:50:12 2023	(r38418)
+++ trunk/libvo/vo_xvmc.c	Sun Apr 23 01:58:52 2023	(r38419)
@@ -203,7 +203,7 @@ static int allocate_xvimage(int xvimage_
         if (!xvimage->data_size)
             goto shmgetfail;
 
-        Shminfo.shmid    = shmget(IPC_PRIVATE, xvimage->data_size, IPC_CREAT | 0777);
+        Shminfo.shmid    = shmget(IPC_PRIVATE, xvimage->data_size, IPC_CREAT | SHM_R | SHM_W);
         if (Shminfo.shmid == -1)
             goto shmgetfail;
         Shminfo.shmaddr  = (char *) shmat(Shminfo.shmid, 0, 0);


More information about the MPlayer-cvslog mailing list