Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jan 2019 21:50:21 +0000 (UTC)
From:      Ganael LAPLANCHE <martymac@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r489743 - in head/multimedia/libdvdread: . files
Message-ID:  <201901082150.x08LoLQY049146@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: martymac
Date: Tue Jan  8 21:50:21 2019
New Revision: 489743
URL: https://svnweb.freebsd.org/changeset/ports/489743

Log:
  Use statfs(2) instead of getfsfile(3) to get device name from a mount point.
  
  PR:		234694
  Submitted by:	tijl

Added:
  head/multimedia/libdvdread/files/patch-src-dvd_reader.c   (contents, props changed)
Modified:
  head/multimedia/libdvdread/Makefile
  head/multimedia/libdvdread/distinfo

Modified: head/multimedia/libdvdread/Makefile
==============================================================================
--- head/multimedia/libdvdread/Makefile	Tue Jan  8 21:42:57 2019	(r489742)
+++ head/multimedia/libdvdread/Makefile	Tue Jan  8 21:50:21 2019	(r489743)
@@ -3,6 +3,7 @@
 
 PORTNAME=	libdvdread
 PORTVERSION=	6.0.0
+PORTREVISION=	1
 CATEGORIES=	multimedia
 MASTER_SITES=	http://download.videolan.org/pub/videolan/libdvdread/${PORTVERSION}/ \
 		http://dvdnav.mplayerhq.hu/releases/ \

Modified: head/multimedia/libdvdread/distinfo
==============================================================================
--- head/multimedia/libdvdread/distinfo	Tue Jan  8 21:42:57 2019	(r489742)
+++ head/multimedia/libdvdread/distinfo	Tue Jan  8 21:50:21 2019	(r489743)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1516309125
+TIMESTAMP = 1546990033
 SHA256 (libdvdread-6.0.0.tar.bz2) = b33b1953b4860545b75f6efc06e01d9849e2ea4f797652263b0b4af6dd10f935
 SIZE (libdvdread-6.0.0.tar.bz2) = 394627

Added: head/multimedia/libdvdread/files/patch-src-dvd_reader.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/libdvdread/files/patch-src-dvd_reader.c	Tue Jan  8 21:50:21 2019	(r489743)
@@ -0,0 +1,50 @@
+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	2018-01-17 21:35:39 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>
+@@ -420,7 +420,7 @@ static dvd_reader_t *DVDOpenCommon( const char *ppath,
+   } else if( S_ISDIR( fileinfo.st_mode ) ) {
+     dvd_reader_t *auth_drive = 0;
+ #if defined(SYS_BSD)
+-    struct fstab* fe;
++    struct statfs fs;
+ #elif defined(__sun) || defined(__linux__)
+     FILE *mntfile;
+ #endif
+@@ -511,14 +511,16 @@ static dvd_reader_t *DVDOpenCommon( const char *ppath,
+         }
+     }
+ #elif defined(SYS_BSD)
+-    if( ( fe = getfsfile( path_copy ) ) ) {
+-      dev_name = bsd_block2char( fe->fs_spec );
+-      fprintf( stderr,
+-               "libdvdread: Attempting to use device %s"
+-               " mounted on %s for CSS authentication\n",
+-               dev_name,
+-               fe->fs_file );
+-      auth_drive = DVDOpenImageFile( dev_name, NULL, NULL, have_css );
++    if( statfs( path_copy, &fs ) == 0 ) {
++        if( !strcmp( path_copy, fs.f_mntonname ) ) {
++            dev_name = bsd_block2char( fs.f_mntfromname );
++            fprintf( stderr,
++                     "libdvdread: Attempting to use device %s"
++                     " mounted on %s for CSS authentication\n",
++                     dev_name,
++                     fs.f_mntonname );
++            auth_drive = DVDOpenImageFile( dev_name, NULL, NULL, have_css );
++        }
+     }
+ #elif defined(__sun)
+     mntfile = fopen( MNTTAB, "r" );



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901082150.x08LoLQY049146>