Your message dated Fri, 09 Sep 2011 11:47:41 +0000
with message-id <[email protected]>
and subject line Bug#640803: fixed in libdvdread 4.1.4-1219-2
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-2

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-2_i386.deb
  to main/libd/libdvdread/libdvdread-dbg_4.1.4-1219-2_i386.deb
libdvdread-dev_4.1.4-1219-2_i386.deb
  to main/libd/libdvdread/libdvdread-dev_4.1.4-1219-2_i386.deb
libdvdread4_4.1.4-1219-2_i386.deb
  to main/libd/libdvdread/libdvdread4_4.1.4-1219-2_i386.deb
libdvdread_4.1.4-1219-2.debian.tar.gz
  to main/libd/libdvdread/libdvdread_4.1.4-1219-2.debian.tar.gz
libdvdread_4.1.4-1219-2.dsc
  to main/libd/libdvdread/libdvdread_4.1.4-1219-2.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: Fri, 09 Sep 2011 13:28:59 +0200
Source: libdvdread
Binary: libdvdread4 libdvdread-dbg libdvdread-dev
Architecture: source i386
Version: 4.1.4-1219-2
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-2) unstable; urgency=low
 .
   * Updating maintainer and uploaders fields.
   * Removing vcs fields.
   * Updating to standards version 3.9.2.
   * Removing references to my old email address.
   * Makging packaging distribution neutral.
   * Compacting copyright file.
   * Adding patch from Svante Signell <[email protected]> to fix
     FTBFS on hurd (Closes: #640803).
Checksums-Sha1: 
 27875a94947028a3df93db00c4a10c978bed1701 1099 libdvdread_4.1.4-1219-2.dsc
 eeba83b1cf6803b91f7c51075f32fa4bcf15188c 9996 
libdvdread_4.1.4-1219-2.debian.tar.gz
 044bf295627ca268f1de173a25f7680d42e36c4f 58204 
libdvdread4_4.1.4-1219-2_i386.deb
 263eb4589b2b78ba724b9ee5624f7c4c113eda88 50418 
libdvdread-dbg_4.1.4-1219-2_i386.deb
 cdd10ccb44823d816de8378dea479065b25ca058 74492 
libdvdread-dev_4.1.4-1219-2_i386.deb
Checksums-Sha256: 
 d4fc0c4276a78208bf4a284bb8afc46d2bf63014969907c8ae4beea0cac912e2 1099 
libdvdread_4.1.4-1219-2.dsc
 429e1d595b340abd6d4d80f21bd85e2509338c817965d66343b211b6a4e95359 9996 
libdvdread_4.1.4-1219-2.debian.tar.gz
 da689ff57d49e068c40d6c8486b9a2d06c6faaaf71961ab7abe36cb3c3f5dc47 58204 
libdvdread4_4.1.4-1219-2_i386.deb
 36e81d49e8bd20629d23db94a8750ce9465ef309bfc21b89d32d5a4549dc1f3f 50418 
libdvdread-dbg_4.1.4-1219-2_i386.deb
 9aeb24ad7327ea4f47838e5ac1a72f591b34ced8aa6d641b0c54429cd45faa20 74492 
libdvdread-dev_4.1.4-1219-2_i386.deb
Files: 
 1d8127cbf2a2db1b44a60e78bc15b6e6 1099 graphics optional 
libdvdread_4.1.4-1219-2.dsc
 0b85c6de48da36b546f2bba0a16d8969 9996 graphics optional 
libdvdread_4.1.4-1219-2.debian.tar.gz
 6216e22e60464ebe049c4a32963bf92e 58204 libs optional 
libdvdread4_4.1.4-1219-2_i386.deb
 19643f2ff0c4b5c2c263253522b87e91 50418 debug extra 
libdvdread-dbg_4.1.4-1219-2_i386.deb
 a59789794cd652b987fce3317b1bb40c 74492 libdevel optional 
libdvdread-dev_4.1.4-1219-2_i386.deb

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

iEYEARECAAYFAk5p+iMACgkQ+C5cwEsrK55SFQCfQcDmZag82O6/eC89QTaHZOiF
n/AAn27D5XSEmYZclwNDD/jrQbTILSH6
=hZoM
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to