summaryrefslogtreecommitdiffstats
path: root/contrib/libdvdread
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-10-05 10:40:13 +0200
committerDamiano Galassi <[email protected]>2019-10-05 10:40:13 +0200
commitb8fc24a311d3f0163fd39d758d54096f37dbb8b3 (patch)
tree42738d7729959fd431baf675fe36ef5f76aeb1b3 /contrib/libdvdread
parent9cf6145c6e6ece7741117c59868a12ca57fb15d1 (diff)
dvdread: add an absolute dvdcss path to use when hardened runtime is enabbled.
Diffstat (limited to 'contrib/libdvdread')
-rw-r--r--contrib/libdvdread/A01-macOS-hardened-runtime-dlopen.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/contrib/libdvdread/A01-macOS-hardened-runtime-dlopen.patch b/contrib/libdvdread/A01-macOS-hardened-runtime-dlopen.patch
new file mode 100644
index 000000000..2e2fd690a
--- /dev/null
+++ b/contrib/libdvdread/A01-macOS-hardened-runtime-dlopen.patch
@@ -0,0 +1,26 @@
+diff --git a/src/dvd_input.c b/src/dvd_input.c
+index d28efe7..4de0ce7 100644
+--- a/src/dvd_input.c
++++ b/src/dvd_input.c
+@@ -277,6 +277,7 @@ int dvdinput_setup(void)
+
+ #ifdef __APPLE__
+ #define CSS_LIB "libdvdcss.2.dylib"
++ #define CSS_USR_LOCAL_LIB "/usr/local/lib/libdvdcss.2.dylib"
+ #elif defined(WIN32)
+ #define CSS_LIB "libdvdcss-2.dll"
+ #elif defined(__OS2__)
+@@ -286,6 +287,13 @@ int dvdinput_setup(void)
+ #endif
+ dvdcss_library = dlopen(CSS_LIB, RTLD_LAZY);
+
++#ifdef __APPLE__
++ // Use the absolute path, required by the hardened runtime
++ if(dvdcss_library == NULL) {
++ dvdcss_library = dlopen(CSS_USR_LOCAL_LIB, RTLD_LAZY);
++ }
++#endif
++
+ if(dvdcss_library != NULL) {
+ #if defined(__OpenBSD__) && !defined(__ELF__) || defined(__OS2__)
+ #define U_S "_"