notfound 358497 0.12.12-1 notfound 358497 0.12.16-1 reassign 358497 mkisofs found 358497 4:2.01+01a03-4 found 358497 4:2.01+01a03-5 found 358497 5:1.0~pre1-1 found 358497 5:1.0~pre2-1 found 358497 5:1.0~pre3-1 found 358497 5:1.0~pre4-1 retitle 358497 mkisofs does not capitalize filenames when it's supposed to severity 358497 grave tags 358497 + patch thanks
Hello, yesterday yet another time I was hit by this bug and I finally decided to track it down. Fortunately, I was lucky so here it goes the results of my investigation. To verify a written CD/DVD, k3b needs to read all files from the CD/DVD and compare their checksums against ones of the original files. k3b uses ISO9660 filenames to locate files on the CD/DVD. Since it's mkisofs that generates ISO9660 names, but it never reveals them to k3b, so k3b itself includes a bunch of mkisofs ISO9660 filename generation code to predict ISO9660 filenames which mkisofs will generate. During verification process, k3b uses those predicted ISO9660 filenames to access files on the CD/DVD. As it is clear from the history of this bug, k3b usually fails to find written files on the CD/DVD, which means that predicted ISO9660 filenames and actual ones generated by mkisofs and written to the disk differ. As it later turned out, they differ only in letter case... ISO9660 standard requires all filenames to be in uppercase and it's mkisofs default behaviour to convert all filenames for ISO9660 FS to uppercase unless --allow-lowercase is specified. By default k3b does not pass this option to mkisofs so it expects all ISO9660 filenames to be in uppercase. Unfortunately, all mkisofs versions since 4:2.01+01a03-4 inclusive *always* preserves an original case of the filenames regardless if there was --allow-lowercase specified or not. Thus mkisofs since 4:2.01+01a03-4 has unconditionally been producing images violating ISO9660 standard (hence the severity of this bug). Below goes the 'why' part. There were a couple of new patches included in 4:2.01+01a03-4 one of them being 33_extra_arch_boot_support.dpatch There is nothing wrong with the code in the patch although this patch is the one responsible for this bug. The patch introduced a new header file "mkisofs/endian.h", which name happens to be the same as /usr/include/endian.h Now /usr/include/ctype.h (home of islower() ) #include <endian.h> (and expects /usr/include/endian.h) which is vital for islower() to work properly. Now what happends in our case: -I. is passed to gcc, so the compiler first finds endian.h in the working directory (mkisofs) and, as a result, /usr/include/endian.h never gets included. Thus islower() at mkisofs/name.c silently starts producing incorrect results, i.e. it always returns 0 regardless of the case of the char passed to it. So conditional clause at name.c always evaluates to false and toupper() never gets executed. As a result original case of the filename is always preserved, which IS BAD. I could think of two solutions: 1) Stop searching a working directory for includes ( gcc -I. ) I think this is bad programming style, since #include "header.h" exists for that purpose. I attach a patch which modifies CMakeLists.txt and a few .c files to get rid of -I. completely. The patch is against cdrkit_1.0~pre4-1. I have tested a resulting package. Debs built fine and k3b successfully written and verified a few data CD/DVDs with new debs installed. P.S. If you apply my patch, you can remove symlinks in mkisofs/diag/. 2) Rename mkisofs/endian.h so it won't clash with /usr/include/endian.h But who knows if something else does not clash or won't clash in the future?... I except . not to be an include dir. In my opinion, a union of both solutions would be the best way to go....
diff -uNr cdrkit-1.0~pre4/cdda2wav/CMakeLists.txt cdrkit-1.0~pre4/cdda2wav/CMakeLists.txt --- cdrkit-1.0~pre4/cdda2wav/CMakeLists.txt 2006-09-05 10:04:37.000000000 +0300 +++ cdrkit-1.0~pre4/cdda2wav/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (CDDA2WAV) -INCLUDE_DIRECTORIES(../include ../cdrecord . ${CMAKE_BINARY_DIR}) +INCLUDE_DIRECTORIES(../include ../cdrecord ${CMAKE_BINARY_DIR}) include(../include/AddScgBits.cmake) FIND_FILE (HAVE_SYS_SOUNDCARD_H sys/soundcard.h) diff -uNr cdrkit-1.0~pre4/cdrecord/CMakeLists.txt cdrkit-1.0~pre4/cdrecord/CMakeLists.txt --- cdrkit-1.0~pre4/cdrecord/CMakeLists.txt 2006-09-06 18:58:47.000000000 +0300 +++ cdrkit-1.0~pre4/cdrecord/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (CDRECORD) -INCLUDE_DIRECTORIES(../include . ${CMAKE_BINARY_DIR}) +INCLUDE_DIRECTORIES(../include ${CMAKE_BINARY_DIR}) INCLUDE(../include/AddScgBits.cmake) AUX_SOURCE_DIRECTORY(. CDRECORD_SRCS) diff -uNr cdrkit-1.0~pre4/cdrecord/drv_mmc.c cdrkit-1.0~pre4/cdrecord/drv_mmc.c --- cdrkit-1.0~pre4/cdrecord/drv_mmc.c 2006-09-03 16:29:34.000000000 +0300 +++ cdrkit-1.0~pre4/cdrecord/drv_mmc.c 2006-09-14 23:06:57.000000000 +0300 @@ -60,7 +60,7 @@ #include <scg/scsireg.h> #include <scg/scsitransp.h> -#include <scsimmc.h> +#include "scsimmc.h" #include "mmcvendor.h" #include "cdrecord.h" diff -uNr cdrkit-1.0~pre4/libdeflt/CMakeLists.txt cdrkit-1.0~pre4/libdeflt/CMakeLists.txt --- cdrkit-1.0~pre4/libdeflt/CMakeLists.txt 2006-08-25 19:54:59.000000000 +0300 +++ cdrkit-1.0~pre4/libdeflt/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (LIBdeflt) -INCLUDE_DIRECTORIES(../include ../libhfs_iso . ${CMAKE_BINARY_DIR} ../cdrecord) +INCLUDE_DIRECTORIES(../include ../libhfs_iso ${CMAKE_BINARY_DIR} ../cdrecord) ADD_DEFINITIONS(-DHAVE_CONFIG_H) SET(LIBdeflt_SRCS default.c) diff -uNr cdrkit-1.0~pre4/libhfs_iso/CMakeLists.txt cdrkit-1.0~pre4/libhfs_iso/CMakeLists.txt --- cdrkit-1.0~pre4/libhfs_iso/CMakeLists.txt 2006-08-25 19:54:59.000000000 +0300 +++ cdrkit-1.0~pre4/libhfs_iso/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (LIBhfs_iso) -INCLUDE_DIRECTORIES(../include ../libhfs_iso . ../cdrecord ${CMAKE_BINARY_DIR}) +INCLUDE_DIRECTORIES(../include ../libhfs_iso ../cdrecord ${CMAKE_BINARY_DIR}) ADD_DEFINITIONS(-DUSE_LARGEFILES -DABORT_DEEP_ISO_ONLY -DAPPLE_HYB -DUDF -DDVD_VIDEO -DSORTING -DHAVE_CONFIG_H -DUSE_LIBSCHILY -DUSE_SCG) diff -uNr cdrkit-1.0~pre4/libparanoia/CMakeLists.txt cdrkit-1.0~pre4/libparanoia/CMakeLists.txt --- cdrkit-1.0~pre4/libparanoia/CMakeLists.txt 2006-08-25 19:54:59.000000000 +0300 +++ cdrkit-1.0~pre4/libparanoia/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (LIBparanoia) -INCLUDE_DIRECTORIES(../include . ${CMAKE_BINARY_DIR} ../cdrecord) +INCLUDE_DIRECTORIES(../include ${CMAKE_BINARY_DIR} ../cdrecord) ADD_DEFINITIONS(-DHAVE_CONFIG_H) SET(LIBparanoia_SRCS gap.c isort.c overlap.c p_block.c paranoia.c pmalloc.c) diff -uNr cdrkit-1.0~pre4/libscg/CMakeLists.txt cdrkit-1.0~pre4/libscg/CMakeLists.txt --- cdrkit-1.0~pre4/libscg/CMakeLists.txt 2006-09-05 10:04:37.000000000 +0300 +++ cdrkit-1.0~pre4/libscg/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (LIBSCG) -INCLUDE_DIRECTORIES(../include . ${CMAKE_BINARY_DIR} ../cdrecord) +INCLUDE_DIRECTORIES(../include ${CMAKE_BINARY_DIR} ../cdrecord) include(../include/AddScgBits.cmake) #SET(LIBSCG_SRCS rdummy.c scgsettarget.c scgtimes.c scsi-linux-ata.c scsi-linux-pg.c scsi-linux-sg.c scsierrs.c scsihack.c scsihelp.c scsiopen.c scsitransp.c) diff -uNr cdrkit-1.0~pre4/libschily/CMakeLists.txt cdrkit-1.0~pre4/libschily/CMakeLists.txt --- cdrkit-1.0~pre4/libschily/CMakeLists.txt 2006-08-25 19:54:59.000000000 +0300 +++ cdrkit-1.0~pre4/libschily/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (LIBSCHILY) -INCLUDE_DIRECTORIES(../include ../libhfs_iso . ${CMAKE_BINARY_DIR} ../cdrecord) +INCLUDE_DIRECTORIES(../include ../libhfs_iso ${CMAKE_BINARY_DIR} ../cdrecord) SET(LIBSCHILY_SRCS astoi.c astoll.c astoull.c breakline.c cmpbytes.c cmpnullbytes.c comerr.c cvt.c error.c fconv.c fexec.c fillbytes.c findbytes.c findline.c format.c getargs.c getav0.c getdomainname.c geterrno.c getfp.c gethostid.c gethostname.c getpagesize.c handlecond.c jsprintf.c jssnprintf.c jssprintf.c match.c matchl.c movebytes.c printf.c raisecond.c rename.c saveargs.c serrmsg.c seterrno.c setfp.c snprintf.c spawn.c sprintf.c strcatl.c strdup.c streql.c strtod.c swabbytes.c usleep.c stdio/cvmod.c stdio/dat.c stdio/fcons.c stdio/fcons64.c stdio/fdown.c stdio/fdup.c stdio/fdup64.c stdio/ffileread.c stdio/ffilewrite.c stdio/fgetline.c stdio/fgetstr.c stdio/file_raise.c stdio/fileclose.c stdio/fileluopen.c stdio/fileluopen64.c stdio/filemopen.c stdio/filemopen64.c stdio/fileopen.c stdio/fileopen64.c stdio/filepos.c stdio/filepos64.c stdio/fileread.c stdio/filereopen.c stdio/filereopen64.c stdio/fileseek.c stdio/fileseek64.c stdio/filesize.c stdio/filesize64.c stdio/filestat.c stdio/filestat64.c stdio/filewrite.c stdio/flag.c stdio/flush.c stdio/fpipe.c stdio/niread.c stdio/niwrite.c stdio/nixread.c stdio/nixwrite.c stdio/openfd.c stdio/openfd64.c stdio/peekc.c ) diff -uNr cdrkit-1.0~pre4/libunls/CMakeLists.txt cdrkit-1.0~pre4/libunls/CMakeLists.txt --- cdrkit-1.0~pre4/libunls/CMakeLists.txt 2006-08-31 01:04:11.000000000 +0300 +++ cdrkit-1.0~pre4/libunls/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (LIBunls) -INCLUDE_DIRECTORIES(../include ../libhfs_iso . ../cdrecord ${CMAKE_BINARY_DIR}) +INCLUDE_DIRECTORIES(../include ../libhfs_iso ../cdrecord ${CMAKE_BINARY_DIR}) ADD_DEFINITIONS(-DHAVE_CONFIG_H) FIND_FILE (USE_ICONV iconv.h) diff -uNr cdrkit-1.0~pre4/mkisofs/apple.c cdrkit-1.0~pre4/mkisofs/apple.c --- cdrkit-1.0~pre4/mkisofs/apple.c 2006-09-03 16:29:34.000000000 +0300 +++ cdrkit-1.0~pre4/mkisofs/apple.c 2006-09-14 23:14:27.000000000 +0300 @@ -58,7 +58,7 @@ #include <utypes.h> #include <ctype.h> #include <netinet/in.h> -#include <apple.h> +#include "apple.h" #include <schily.h> #ifdef USE_MAGIC diff -uNr cdrkit-1.0~pre4/mkisofs/CMakeLists.txt cdrkit-1.0~pre4/mkisofs/CMakeLists.txt --- cdrkit-1.0~pre4/mkisofs/CMakeLists.txt 2006-09-05 10:04:37.000000000 +0300 +++ cdrkit-1.0~pre4/mkisofs/CMakeLists.txt 2006-09-14 23:19:58.000000000 +0300 @@ -2,7 +2,7 @@ INCLUDE(../include/AddScgBits.cmake) -INCLUDE_DIRECTORIES(../include ../libhfs_iso . ../cdrecord ${CMAKE_BINARY_DIR}) +INCLUDE_DIRECTORIES(../include ../libhfs_iso ../cdrecord ${CMAKE_BINARY_DIR}) FIND_FILE (USE_MAGIC magic.h) IF(USE_MAGIC) @@ -33,7 +33,7 @@ # common lib set and mkisofs source parts for the rest LINK_LIBRARIES(${SCG_LIBS} schily deflt unls ${EXTRA_LIBICONV} ) -SET(MI_COMMON diag/scsi.c diag/scsi_cdr.c diag/cd_misc.c diag/modes.c diag/defaults.c diag/getnum.c) +SET(MI_COMMON scsi.c scsi_cdr.c cd_misc.c modes.c defaults.c getnum.c) ADD_EXECUTABLE(devdump diag/dump.c ${MI_COMMON}) ADD_EXECUTABLE(isodebug diag/isodebug.c ${MI_COMMON}) ADD_EXECUTABLE(isodump diag/isodump.c ${MI_COMMON}) diff -uNr cdrkit-1.0~pre4/mkisofs/fnmatch.c cdrkit-1.0~pre4/mkisofs/fnmatch.c --- cdrkit-1.0~pre4/mkisofs/fnmatch.c 2006-09-05 11:39:04.000000000 +0300 +++ cdrkit-1.0~pre4/mkisofs/fnmatch.c 2006-09-14 23:15:15.000000000 +0300 @@ -35,12 +35,12 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H -#include <config.h> +#include "config.h" #endif #include <errno.h> #include <utypes.h> -#include <fnmatch.h> +#include "fnmatch.h" #ifndef __STDC__ #define const diff -uNr cdrkit-1.0~pre4/mkisofs/mac_label.c cdrkit-1.0~pre4/mkisofs/mac_label.c --- cdrkit-1.0~pre4/mkisofs/mac_label.c 2006-09-05 11:39:04.000000000 +0300 +++ cdrkit-1.0~pre4/mkisofs/mac_label.c 2006-09-14 23:15:36.000000000 +0300 @@ -58,7 +58,7 @@ #include <mconfig.h> #include "mkisofs.h" -#include <mac_label.h> +#include "mac_label.h" #include "apple.h" #ifdef PREP_BOOT diff -uNr cdrkit-1.0~pre4/readcd/CMakeLists.txt cdrkit-1.0~pre4/readcd/CMakeLists.txt --- cdrkit-1.0~pre4/readcd/CMakeLists.txt 2006-09-05 10:04:37.000000000 +0300 +++ cdrkit-1.0~pre4/readcd/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (READECD) -INCLUDE_DIRECTORIES(../include ../cdrecord . ${CMAKE_BINARY_DIR}) +INCLUDE_DIRECTORIES(../include ../cdrecord ${CMAKE_BINARY_DIR}) INCLUDE(../include/AddScgBits.cmake) AUX_SOURCE_DIRECTORY(. READCD_SRCS) diff -uNr cdrkit-1.0~pre4/rscsi/CMakeLists.txt cdrkit-1.0~pre4/rscsi/CMakeLists.txt --- cdrkit-1.0~pre4/rscsi/CMakeLists.txt 2006-09-05 10:04:37.000000000 +0300 +++ cdrkit-1.0~pre4/rscsi/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (RSCSI) -INCLUDE_DIRECTORIES(../include ../cdrecord . ${CMAKE_BINARY_DIR} ) +INCLUDE_DIRECTORIES(../include ../cdrecord ${CMAKE_BINARY_DIR} ) INCLUDE(../include/AddScgBits.cmake) LINK_DIRECTORIES(../libschily ../libscg ../libdeflt) diff -uNr cdrkit-1.0~pre4/scgcheck/CMakeLists.txt cdrkit-1.0~pre4/scgcheck/CMakeLists.txt --- cdrkit-1.0~pre4/scgcheck/CMakeLists.txt 2006-09-05 10:04:37.000000000 +0300 +++ cdrkit-1.0~pre4/scgcheck/CMakeLists.txt 2006-09-14 23:04:48.000000000 +0300 @@ -1,5 +1,5 @@ PROJECT (SCGCHECK) -INCLUDE_DIRECTORIES(../include ../cdrecord . ) +INCLUDE_DIRECTORIES(../include ../cdrecord ) INCLUDE(../include/AddScgBits.cmake)
pgplfdSYJaQgu.pgp
Description: PGP signature