Your message dated Wed, 28 Sep 2011 12:20:43 +0000
with message-id <[email protected]>
and subject line Bug#640803: fixed in libdvdread 4.1.4-1219-3
has caused the Debian Bug report #640803,
regarding libdvdread: Fix FTBFS on hurd-i386
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
640803: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640803
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libdvdread
Version: 4.1.4-1219
Severity: important
Tags: patch
User: [email protected]
Usertags: hurd

Hello,

libdvdread FTBFS on hurd-i386 due to PATH_MAX usage, which is not
defined on GNU/Hurd. The attached patch fixes these problems by using
dynamic buffer allocation. It can conveniently be added last in the patch
series.

Thanks,
Svante


diff -ur libdvdread-4.1.4-1219/src/dvd_reader.c libdvdread-4.1.4-1219.modified//src/dvd_reader.c
--- libdvdread-4.1.4-1219/src/dvd_reader.c	2010-07-31 02:10:28.000000000 +0200
+++ libdvdread-4.1.4-1219.modified//src/dvd_reader.c	2011-09-07 15:48:37.000000000 +0200
@@ -424,6 +424,12 @@
         if( chdir( path_copy ) == -1 ) {
           goto DVDOpen_error;
         }
+#ifdef __GLIBC__
+        new_path = get_current_dir_name();
+        if(new_path == NULL) {
+          goto DVDOpen_error;
+        }
+#else
         new_path = malloc(PATH_MAX+1);
         if(!new_path) {
           goto DVDOpen_error;
@@ -431,6 +437,7 @@
         if( getcwd( new_path, PATH_MAX ) == NULL ) {
           goto DVDOpen_error;
         }
+#endif
         retval = fchdir( cdir );
         close( cdir );
         cdir = -1;
@@ -625,17 +632,23 @@
  *     or -1 on file not found.
  *     or -2 on path not found.
  */
-static int findDirFile( const char *path, const char *file, char *filename )
+static int findDirFile( const char *path, const char *file, char **filename )
 {
   DIR *dir;
   struct dirent *ent;
+  *filename = NULL;
 
   dir = opendir( path );
   if( !dir ) return -2;
 
   while( ( ent = readdir( dir ) ) != NULL ) {
     if( !strcasecmp( ent->d_name, file ) ) {
-      sprintf( filename, "%s%s%s", path,
+      *filename = malloc( strlen( path ) + 1 + strlen( ent->d_name ) + 1 );
+      if( *filename == NULL ) {
+        closedir(dir);
+        return -1;
+      }
+      sprintf( *filename, "%s%s%s", path,
                ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),
                ent->d_name );
       closedir(dir);
@@ -646,9 +659,9 @@
   return -1;
 }
 
-static int findDVDFile( dvd_reader_t *dvd, const char *file, char *filename )
+static int findDVDFile( dvd_reader_t *dvd, const char *file, char **filename )
 {
-  char video_path[ PATH_MAX + 1 ];
+  char *video_path = NULL;
   const char *nodirfile;
   int ret;
 
@@ -662,6 +675,8 @@
   ret = findDirFile( dvd->path_root, nodirfile, filename );
   if( ret < 0 ) {
     /* Try also with adding the path, just in case. */
+    video_path = malloc( strlen( dvd->path_root ) + 10 + 1 );
+    if( video_path == NULL ) return 0;
     sprintf( video_path, "%s/VIDEO_TS/", dvd->path_root );
     ret = findDirFile( video_path, nodirfile, filename );
     if( ret < 0 ) {
@@ -669,9 +684,11 @@
       sprintf( video_path, "%s/video_ts/", dvd->path_root );
       ret = findDirFile( video_path, nodirfile, filename );
       if( ret < 0 ) {
+        free( video_path );
         return 0;
       }
     }
+    free( video_path );
   }
 
   return 1;
@@ -682,20 +699,22 @@
  */
 static dvd_file_t *DVDOpenFilePath( dvd_reader_t *dvd, char *filename )
 {
-  char full_path[ PATH_MAX + 1 ];
+  char *full_path = NULL;
   dvd_file_t *dvd_file;
   struct stat fileinfo;
   dvd_input_t dev;
 
   /* Get the full path of the file. */
-  if( !findDVDFile( dvd, filename, full_path ) ) {
+  if( !findDVDFile( dvd, filename, &full_path ) ) {
     fprintf( stderr, "libdvdnav:DVDOpenFilePath:findDVDFile %s failed\n", filename );
+    free( full_path );
     return NULL;
   }
 
   dev = dvdinput_open( full_path );
   if( !dev ) {
     fprintf( stderr, "libdvdnav:DVDOpenFilePath:dvdinput_open %s failed\n", full_path );
+    free( full_path );
     return NULL;
   }
 
@@ -703,6 +722,7 @@
   if( !dvd_file ) {
     fprintf( stderr, "libdvdnav:DVDOpenFilePath:dvd_file malloc failed\n" );
     dvdinput_close(dev);
+    free( full_path );
     return NULL;
   }
   dvd_file->dvd = dvd;
@@ -714,6 +734,7 @@
 
   if( stat( full_path, &fileinfo ) < 0 ) {
     fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
+    free( full_path );
     free( dvd_file );
     return NULL;
   }
@@ -721,6 +742,7 @@
   dvd_file->title_devs[ 0 ] = dev;
   dvd_file->filesize = dvd_file->title_sizes[ 0 ];
 
+  free( full_path );
   return dvd_file;
 }
 
@@ -776,7 +798,7 @@
 static dvd_file_t *DVDOpenVOBPath( dvd_reader_t *dvd, int title, int menu )
 {
   char filename[ MAX_UDF_FILE_NAME_LEN ];
-  char full_path[ PATH_MAX + 1 ];
+  char *full_path = NULL;
   struct stat fileinfo;
   dvd_file_t *dvd_file;
   int i;
@@ -799,13 +821,15 @@
     } else {
       sprintf( filename, "VTS_%02i_0.VOB", title );
     }
-    if( !findDVDFile( dvd, filename, full_path ) ) {
+    if( !findDVDFile( dvd, filename, &full_path ) ) {
+      free( full_path );
       free( dvd_file );
       return NULL;
     }
 
     dev = dvdinput_open( full_path );
     if( dev == NULL ) {
+      free( full_path );
       free( dvd_file );
       return NULL;
     }
@@ -813,6 +837,7 @@
     if( stat( full_path, &fileinfo ) < 0 ) {
       fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
       dvdinput_close(dev);
+      free( full_path );
       free( dvd_file );
       return NULL;
     }
@@ -825,7 +850,7 @@
     for( i = 0; i < TITLES_MAX; ++i ) {
 
       sprintf( filename, "VTS_%02i_%i.VOB", title, i + 1 );
-      if( !findDVDFile( dvd, filename, full_path ) ) {
+      if( !findDVDFile( dvd, filename, &full_path ) ) {
         break;
       }
 
@@ -840,11 +865,12 @@
       dvd_file->filesize += dvd_file->title_sizes[ i ];
     }
     if( !dvd_file->title_devs[ 0 ] ) {
+      free( full_path );
       free( dvd_file );
       return NULL;
     }
   }
-
+  free( full_path );
   return dvd_file;
 }
 
@@ -966,7 +992,7 @@
                                int menu, dvd_stat_t *statbuf )
 {
   char filename[ MAX_UDF_FILE_NAME_LEN ];
-  char full_path[ PATH_MAX + 1 ];
+  char *full_path = NULL;
   struct stat fileinfo;
   off_t tot_size;
   off_t parts_size[ 9 ];
@@ -978,11 +1004,13 @@
   else
     sprintf( filename, "VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
 
-  if( !findDVDFile( dvd, filename, full_path ) )
+  if( !findDVDFile( dvd, filename, &full_path ) )
+    free( full_path );
     return -1;
 
   if( stat( full_path, &fileinfo ) < 0 ) {
     fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
+    free( full_path );
     return -1;
   }
 
@@ -994,7 +1022,7 @@
     int cur;
     for( cur = 2; cur < 10; cur++ ) {
       sprintf( filename, "VTS_%02d_%d.VOB", title, cur );
-      if( !findDVDFile( dvd, filename, full_path ) )
+      if( !findDVDFile( dvd, filename, &full_path ) )
         break;
 
       if( stat( full_path, &fileinfo ) < 0 ) {
@@ -1013,6 +1041,7 @@
   for( n = 0; n < nr_parts; n++ )
     statbuf->parts_size[ n ] = parts_size[ n ];
 
+  free( full_path );
   return 0;
 }
 
@@ -1021,7 +1050,7 @@
                  dvd_read_domain_t domain, dvd_stat_t *statbuf )
 {
   char filename[ MAX_UDF_FILE_NAME_LEN ];
-  char full_path[ PATH_MAX + 1 ];
+  char *full_path = NULL;
   struct stat fileinfo;
   uint32_t size;
 
@@ -1077,17 +1106,19 @@
       return 0;
     }
   } else {
-    if( findDVDFile( dvd, filename, full_path ) ) {
+    if( findDVDFile( dvd, filename, &full_path ) ) {
       if( stat( full_path, &fileinfo ) < 0 )
         fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
       else {
         statbuf->size = fileinfo.st_size;
         statbuf->nr_parts = 1;
         statbuf->parts_size[ 0 ] = statbuf->size;
+        free( full_path );
         return 0;
       }
     }
   }
+  free( full_path );
   return -1;
 }
 

--- End Message ---
--- Begin Message ---
Source: libdvdread
Source-Version: 4.1.4-1219-3

We believe that the bug you reported is fixed in the latest version of
libdvdread, which is due to be installed in the Debian FTP archive:

libdvdread-dbg_4.1.4-1219-3_i386.deb
  to main/libd/libdvdread/libdvdread-dbg_4.1.4-1219-3_i386.deb
libdvdread-dev_4.1.4-1219-3_i386.deb
  to main/libd/libdvdread/libdvdread-dev_4.1.4-1219-3_i386.deb
libdvdread4_4.1.4-1219-3_i386.deb
  to main/libd/libdvdread/libdvdread4_4.1.4-1219-3_i386.deb
libdvdread_4.1.4-1219-3.debian.tar.gz
  to main/libd/libdvdread/libdvdread_4.1.4-1219-3.debian.tar.gz
libdvdread_4.1.4-1219-3.dsc
  to main/libd/libdvdread/libdvdread_4.1.4-1219-3.dsc



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Baumann <[email protected]> (supplier of updated 
libdvdread package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 28 Sep 2011 14:07:28 +0200
Source: libdvdread
Binary: libdvdread4 libdvdread-dbg libdvdread-dev
Architecture: source i386
Version: 4.1.4-1219-3
Distribution: unstable
Urgency: low
Maintainer: Daniel Baumann <[email protected]>
Changed-By: Daniel Baumann <[email protected]>
Description: 
 libdvdread-dbg - library for reading DVDs (debug)
 libdvdread-dev - library for reading DVDs (development)
 libdvdread4 - library for reading DVDs
Closes: 640803
Changes: 
 libdvdread (4.1.4-1219-3) unstable; urgency=low
 .
   * Removing some more references to my old email address.
   * Adding updated patch from Svante Signell <[email protected]>
     to fix FTBFS on hurd (Closes: #640803).
Checksums-Sha1: 
 e20671211c2e0fda1a3c7a98defd265d5ce90b8c 1218 libdvdread_4.1.4-1219-3.dsc
 6b52502cb3412c0542901b486aace43229966792 10030 
libdvdread_4.1.4-1219-3.debian.tar.gz
 5b87035adfc5f2557cac4b249ed06f4d346317f9 58344 
libdvdread4_4.1.4-1219-3_i386.deb
 fd9de7c8a77f239ae9f91798d1860a0874f2cdb2 50454 
libdvdread-dbg_4.1.4-1219-3_i386.deb
 467a7f698a4e16fea2f1355dad3681b7fcd7a4f8 74674 
libdvdread-dev_4.1.4-1219-3_i386.deb
Checksums-Sha256: 
 ff08350883df2c1baab3237d734e6d3b953b32b5c5389bb21de84e8e786d4460 1218 
libdvdread_4.1.4-1219-3.dsc
 daa1f87838c1fba02eab6ad89d08f84ae407bf67ed3f328a90309bffb51da3f9 10030 
libdvdread_4.1.4-1219-3.debian.tar.gz
 1c68425667df3059d334bca4cd70920097eaa14e48c1321e7cf88d41cfcc12f6 58344 
libdvdread4_4.1.4-1219-3_i386.deb
 dc8c4c28608b4b8dcb1fa3068e15f836a144eaeb3db40d5784e3cf34e7a410a5 50454 
libdvdread-dbg_4.1.4-1219-3_i386.deb
 f5b71cc1892227f6f9c7959749e90a201c7c44cb2d2e02cc553682e54835491f 74674 
libdvdread-dev_4.1.4-1219-3_i386.deb
Files: 
 221328f5c38fc2ec46265637af61f032 1218 graphics optional 
libdvdread_4.1.4-1219-3.dsc
 a8e405ba5eff23c31be68096ca0300d5 10030 graphics optional 
libdvdread_4.1.4-1219-3.debian.tar.gz
 4dbf6a3d45bf603f9ca0845d12da1427 58344 libs optional 
libdvdread4_4.1.4-1219-3_i386.deb
 a76d788297c499638a5a572d396bba4d 50454 debug extra 
libdvdread-dbg_4.1.4-1219-3_i386.deb
 ebdb8c2b7d6acfbd37ed571f86d58066 74674 libdevel optional 
libdvdread-dev_4.1.4-1219-3_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk6DDxYACgkQ+C5cwEsrK55MLgCg5C5TCXGifq2JpAUsb5t++pIl
hyUAn1J+HjHUG+6UeDhjJKNkbw0IvrpX
=cZTF
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to