[vlc-commits] cdda: Add macOS permission check
David Fuhrmann
git at videolan.org
Wed May 13 19:30:33 CEST 2020
vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Wed May 6 20:33:10 2020 +0200| [21777d8dec1e7120e7ecb7b65b090d6658d08f14] | committer: David Fuhrmann
cdda: Add macOS permission check
Similar to dvdnav and dvdread.
(cherry picked from commit 1ae5ef9b045f483d1bd0d5ecc3df3f8b4fff5f9f)
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=21777d8dec1e7120e7ecb7b65b090d6658d08f14
---
modules/access/Makefile.am | 3 ++-
modules/access/cdda.c | 7 +++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/modules/access/Makefile.am b/modules/access/Makefile.am
index 21d88af5db..5d2a5f915c 100644
--- a/modules/access/Makefile.am
+++ b/modules/access/Makefile.am
@@ -205,7 +205,8 @@ 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
+libcdda_plugin_la_SOURCES = access/cdda.c access/disc_helper.h access/vcd/cdrom.c \
+ access/vcd/cdrom.h access/vcd/cdrom_internals.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 e52594d30d..6f7ae19cc5 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -50,8 +50,10 @@
#include <vlc_charset.h> /* ToLocaleDup */
#include <vlc_url.h>
+#include "disc_helper.h"
#include "vcd/cdrom.h" /* For CDDA_DATA_SIZE */
+
#ifdef HAVE_LIBCDDB
#include <cddb/cddb.h>
#include <errno.h>
@@ -103,6 +105,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