[vlc-commits] cdda: Add macOS permission check

David Fuhrmann git at videolan.org
Thu May 7 18:38:29 CEST 2020


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Wed May  6 20:33:10 2020 +0200| [1ae5ef9b045f483d1bd0d5ecc3df3f8b4fff5f9f] | committer: David Fuhrmann

cdda: Add macOS permission check

Similar to dvdnav and dvdread.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1ae5ef9b045f483d1bd0d5ecc3df3f8b4fff5f9f
---

 modules/access/Makefile.am | 7 ++++---
 modules/access/cdda.c      | 7 +++++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/access/Makefile.am b/modules/access/Makefile.am
index 5fb23de555..9cd3098fc2 100644
--- a/modules/access/Makefile.am
+++ b/modules/access/Makefile.am
@@ -216,9 +216,10 @@ EXTRA_LTLIBRARIES += libvnc_plugin.la
 
 ### Optical media ###
 
-libcdda_plugin_la_SOURCES = access/cdda.c access/vcd/cdrom.c access/vcd/cdrom.h access/vcd/cdrom_internals.h \
-                            misc/webservices/json.c misc/webservices/json.h misc/webservices/json_helper.h \
-                            misc/webservices/musicbrainz.c misc/webservices/musicbrainz.h
+libcdda_plugin_la_SOURCES = access/cdda.c access/disc_helper.h access/vcd/cdrom.c access/vcd/cdrom.h \
+                            access/vcd/cdrom_internals.h misc/webservices/json.c misc/webservices/json.h \
+                            misc/webservices/json_helper.h misc/webservices/musicbrainz.c \
+                            misc/webservices/musicbrainz.h
 libcdda_plugin_la_CFLAGS = $(AM_CFLAGS) $(LIBCDDB_CFLAGS)
 libcdda_plugin_la_LIBADD = $(LIBCDDB_LIBS) $(LIBM)
 libcdda_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(accessdir)'
diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index 42d0e7c6ca..9260b833ed 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -56,9 +56,11 @@
 # include <vlc_gcrypt.h>
 #endif
 
+#include "disc_helper.h"
 #include "vcd/cdrom.h"  /* For CDDA_DATA_SIZE */
 #include "../misc/webservices/musicbrainz.h"
 
+
 #ifdef HAVE_LIBCDDB
  #include <cddb/cddb.h>
  #include <errno.h>
@@ -110,6 +112,11 @@ static vcddev_t *DiscOpen(vlc_object_t *obj, const char *location,
         devpath[2] = '\0';
 #endif
 
+    if (DiscProbeMacOSPermission(obj, devpath) != VLC_SUCCESS) {
+        free(devpath);
+        return NULL;
+    }
+
     /* Open CDDA */
     vcddev_t *dev = ioctl_Open(obj, devpath);
     if (dev == NULL)



More information about the vlc-commits mailing list