From 8e993c1a64baea60ff1eb108dbffe2ed23f339b0 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Sun, 5 Mar 2017 22:54:33 +0000 Subject: [PATCH] [MKISOFS] Update mkisofs to schily-2017-02-16, which comes with the following fixes: - Fix null termination in libschily's Win32 implementation of opendir (submitted upstream by me). The bug was triggered when building an ISO from a directory instead of a graft-points (.lst) file. - Prevent -duplicates-once from being used together with -cache-inodes. These options exclude each other. svn path=/trunk/; revision=74112 --- .../mkisofs/schilytools/cdrecord/version.h | 4 +- .../schilytools/include/schily/schily.h | 10 ++--- .../mkisofs/schilytools/libschily/dirent.c | 11 +++-- .../mkisofs/schilytools/mkisofs/mkisofs.c | 42 ++++++++++++------- 4 files changed, 40 insertions(+), 27 deletions(-) diff --git a/reactos/sdk/tools/mkisofs/schilytools/cdrecord/version.h b/reactos/sdk/tools/mkisofs/schilytools/cdrecord/version.h index 3161c33436a..5941b33dbeb 100644 --- a/reactos/sdk/tools/mkisofs/schilytools/cdrecord/version.h +++ b/reactos/sdk/tools/mkisofs/schilytools/cdrecord/version.h @@ -1,6 +1,6 @@ -/* @(#)version.h 1.92 16/01/26 Copyright 2007-2016 J. Schilling */ +/* @(#)version.h 1.93 16/12/15 Copyright 2007-2016 J. Schilling */ /* * The version for cdrtools programs */ -#define VERSION "3.02a06" +#define VERSION "3.02a07" diff --git a/reactos/sdk/tools/mkisofs/schilytools/include/schily/schily.h b/reactos/sdk/tools/mkisofs/schilytools/include/schily/schily.h index 74a88e8c7db..d48abbeeb1b 100644 --- a/reactos/sdk/tools/mkisofs/schilytools/include/schily/schily.h +++ b/reactos/sdk/tools/mkisofs/schilytools/include/schily/schily.h @@ -1,4 +1,4 @@ -/* @(#)schily.h 1.121 16/11/04 Copyright 1985-2016 J. Schilling */ +/* @(#)schily.h 1.122 16/12/18 Copyright 1985-2016 J. Schilling */ /* * Definitions for libschily * @@ -543,7 +543,7 @@ extern int _openfd64 __PR((const char *, int)); #ifdef __never__ #undef error #define error js_error -#endif +#endif /* __never__ */ #undef dprintf #define dprintf js_dprintf #undef fprintf @@ -558,9 +558,9 @@ extern int _openfd64 __PR((const char *, int)); #ifndef HAVE_SNPRINTF #undef snprintf #define snprintf js_snprintf -#endif -#endif -#endif +#endif /* HAVE_SNPRINTF */ +#endif /* SCHILY_PRINT */ +#endif /* NO_SCHILY_PRINT */ #ifndef NO_SCHILY_GETLINE /* Define to disable *getline() redirect */ #undef getline diff --git a/reactos/sdk/tools/mkisofs/schilytools/libschily/dirent.c b/reactos/sdk/tools/mkisofs/schilytools/libschily/dirent.c index aa358304513..097956c82c4 100644 --- a/reactos/sdk/tools/mkisofs/schilytools/libschily/dirent.c +++ b/reactos/sdk/tools/mkisofs/schilytools/libschily/dirent.c @@ -1,11 +1,11 @@ -/* @(#)dirent.c 1.3 12/03/20 Copyright 2011 J. Schilling */ +/* @(#)dirent.c 1.4 17/02/02 Copyright 2011-2017 J. Schilling */ #include #ifndef lint static UConst char sccsid[] = - "@(#)dirent.c 1.3 12/03/20 Copyright 2011 J. Schilling"; + "@(#)dirent.c 1.4 17/02/02 Copyright 2011-2017 J. Schilling"; #endif /* - * Copyright (c) 2011 J. Schilling + * Copyright (c) 2011-2017 J. Schilling */ /* * The contents of this file are subject to the terms of the @@ -14,6 +14,8 @@ static UConst char sccsid[] = * with the License. * * See the file CDDL.Schily.txt in this distribution for details. + * A copy of the CDDL is also available via the Internet at + * http://www.opensource.org/licenses/cddl1.txt * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file CDDL.Schily.txt from this distribution. @@ -84,7 +86,8 @@ opendir(dname) dp->dd_dirname[len] = '\\'; len++; } - dp->dd_dirname[len] = '*'; + dp->dd_dirname[len++] = '*'; + dp->dd_dirname[len] = '\0'; dp->dd_handle = -1; dp->dd_state = 0; diff --git a/reactos/sdk/tools/mkisofs/schilytools/mkisofs/mkisofs.c b/reactos/sdk/tools/mkisofs/schilytools/mkisofs/mkisofs.c index a7136a57564..e8a697fe8f2 100644 --- a/reactos/sdk/tools/mkisofs/schilytools/mkisofs/mkisofs.c +++ b/reactos/sdk/tools/mkisofs/schilytools/mkisofs/mkisofs.c @@ -1,8 +1,8 @@ -/* @(#)mkisofs.c 1.288 16/12/13 joerg */ +/* @(#)mkisofs.c 1.289 17/01/05 joerg */ #include #ifndef lint static UConst char sccsid[] = - "@(#)mkisofs.c 1.288 16/12/13 joerg"; + "@(#)mkisofs.c 1.289 17/01/05 joerg"; #endif /* * Program mkisofs.c - generate iso9660 filesystem based upon directory @@ -11,7 +11,7 @@ static UConst char sccsid[] = * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated - * Copyright (c) 1997-2016 J. Schilling + * Copyright (c) 1997-2017 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -132,14 +132,13 @@ BOOL legacy = FALSE; /* Implement legacy support for historic CLI */ int all_files = 1; /* New default is to include all files */ BOOL Hflag = FALSE; /* Follow links on cmdline (-H) */ BOOL follow_links = FALSE; /* Follow all links (-L) */ -#if defined(IS_CYGWIN) || defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) /* - * Do not cache inodes on Cygwin by default - * See below in main(), cache for 64bit ino_t + * Never cache inodes on DOS or Win-DOS. */ int cache_inodes = 0; #else -int cache_inodes = 1; /* Cache inodes if OS has unique inodes */ +int cache_inodes = -1; /* Cache inodes if OS has unique inodes */ #endif int rationalize = 0; /* Need to call stat_fix() */ int rationalize_uid = 0; @@ -2088,14 +2087,6 @@ main(argc, argv) modification_date.l_usec = tv_begun.tv_usec; modification_date.l_gmtoff = -100; -#if defined(IS_CYGWIN) - /* - * If we have 64 bit inode numbers, Cygwin should be able to work - * correctly on NTFS. - */ - if (sizeof (ino_t) >= 8) - cache_inodes = 1; -#endif cac--; cav++; c = getvargs(&cac, &cav, GA_NO_PROPS, flags); @@ -2119,7 +2110,7 @@ args_ok: if (pversion) { printf(_("mkisofs %s (%s-%s-%s)\n\n\ Copyright (C) 1993-1997 %s\n\ -Copyright (C) 1997-2016 %s\n"), +Copyright (C) 1997-2017 %s\n"), version_string, HOST_CPU, HOST_VENDOR, HOST_OS, _("Eric Youngdale"), @@ -2212,6 +2203,25 @@ Copyright (C) 1997-2016 %s\n"), (Llong)strlen(biblio)); } } +#ifdef DUPLICATES_ONCE + /* + * If -duplicates-once was specified, do not implicitly enable + * -cache-inodes. + */ + if (cache_inodes < 0 && duplicates_once) + cache_inodes = 0; +#endif +#if defined(IS_CYGWIN) + /* + * If we have 64 bit inode numbers, Cygwin should be able to work + * correctly on NTFS, otherwise disable caching unless it has + * been enforced via -cache-inodes. + */ + if (cache_inodes < 0 && sizeof (ino_t) < 8) + cache_inodes = 0; +#endif + if (cache_inodes < 0) + cache_inodes = 1; #ifdef DUPLICATES_ONCE if (!cache_inodes && !duplicates_once) { #else