libcdio/c99.patch

79 lines
2.7 KiB
Diff
Raw Normal View History

- Update to 2.1.1: - More checks of potentially NULL buffers. More malloc()/calloc() result checks. - Enforce non-widestring ("A" suffixed) calls when we pass char* parameters. - Use widestring API calls unless otherwise specified. - Remove a deprecation warning of the declaration of is_cdrom_aspi() and GetVersion(). - Updates for compiling on MSVC. - Move to github - Add github CI checks. - Count empty fields as tracks. - Add some validity checks to enhance security. - Add support for ISO9660 multi extent files. - Fix Recognition of multi-extent in ISO9660 when Joliet is present. - Use getmntent/setmntent for reading mounts. - Use GNU/Linux new ioctl on kernel v5.16 or newer. - Use "%s"-style format in cdda-player.c: to make it catch cases when user input is used in place of format. - Remove some memory leaks in C++ code. - Allow for DO_NOT_WANT_COMPATIBILITY macro in config.h to disable APIs that are being retired. - Fix win32 implementation of .get_track_msf() for CD with first track number > 1 - Fix testing on Windows and remove compilation warnings. - Add Rock Ridge deep directory support. - Fix and clean up various Rock Ridge issues and adjust tests. - Fix double reporting of sizes in cd-info.c. - CD-Text character set interpretation more tolerant of bad input. - Remove homegrown boolean type in favor of <stdbool.h>. - Improve pkg-config configuration detection - Fix crash reading CD TOC on macOS Ventura. - Update freedb references to GnuDB. - Fix charset check in Windows cdio_charset_from_utf8 implementation. - Add support for reading CD-Text on macOS and Windows - Remove upstreamed patch: - fix-undefined-behavior-in-readlink.patch - Remove GPG authentication, not supported any more. OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/libcdio?expand=0&rev=78
2025-01-10 13:33:52 +01:00
From 79a15b760e0b5e81b29953acada3a963c3f8eba9 Mon Sep 17 00:00:00 2001
From: Alfred Wingate <parona@protonmail.com>
Date: Mon, 20 May 2024 22:02:08 +0300
Subject: [PATCH] Do not use LFS shims, rely on _FILE_OFFSET_BITS=64
See https://savannah.gnu.org/bugs/?65751 and https://bugs.gentoo.org/918988
Setting _FILE_OFFSET_BITS=64 is enough to get the LFS interface,
using LFS shims is unnecessary on 64-bit systems and they may
not be available on 32-bit systems on glibc.
Signed-off-by: Alfred Wingate <parona@protonmail.com>
---
configure.ac | 8 ++++----
lib/driver/_cdio_generic.c | 12 +-----------
lib/driver/_cdio_stdio.c | 6 +-----
3 files changed, 6 insertions(+), 20 deletions(-)
--- a/configure.ac
+++ b/configure.ac
@@ -539,10 +539,10 @@ AC_SUBST(HAVE_SOLARIS_CDROM)
AC_SUBST(HAVE_WIN32_CDROM)
AC_SUBST(HAVE_OS2_CDROM)
- Update to 2.1.1: - More checks of potentially NULL buffers. More malloc()/calloc() result checks. - Enforce non-widestring ("A" suffixed) calls when we pass char* parameters. - Use widestring API calls unless otherwise specified. - Remove a deprecation warning of the declaration of is_cdrom_aspi() and GetVersion(). - Updates for compiling on MSVC. - Move to github - Add github CI checks. - Count empty fields as tracks. - Add some validity checks to enhance security. - Add support for ISO9660 multi extent files. - Fix Recognition of multi-extent in ISO9660 when Joliet is present. - Use getmntent/setmntent for reading mounts. - Use GNU/Linux new ioctl on kernel v5.16 or newer. - Use "%s"-style format in cdda-player.c: to make it catch cases when user input is used in place of format. - Remove some memory leaks in C++ code. - Allow for DO_NOT_WANT_COMPATIBILITY macro in config.h to disable APIs that are being retired. - Fix win32 implementation of .get_track_msf() for CD with first track number > 1 - Fix testing on Windows and remove compilation warnings. - Add Rock Ridge deep directory support. - Fix and clean up various Rock Ridge issues and adjust tests. - Fix double reporting of sizes in cd-info.c. - CD-Text character set interpretation more tolerant of bad input. - Remove homegrown boolean type in favor of <stdbool.h>. - Improve pkg-config configuration detection - Fix crash reading CD TOC on macOS Ventura. - Update freedb references to GnuDB. - Fix charset check in Windows cdio_charset_from_utf8 implementation. - Add support for reading CD-Text on macOS and Windows - Remove upstreamed patch: - fix-undefined-behavior-in-readlink.patch - Remove GPG authentication, not supported any more. OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/libcdio?expand=0&rev=78
2025-01-10 13:33:52 +01:00
-AC_CHECK_FUNCS( [chdir drand48 fseeko fseeko64 ftruncate geteuid getgid \
- getuid getpwuid gettimeofday lseek64 lstat memcpy memset mkstemp rand \
- seteuid setegid snprintf setenv strndup unsetenv tzset sleep \
- _stati64 usleep vsnprintf readlink realpath gmtime_r localtime_r] )
+AC_CHECK_FUNCS( [chdir drand48 fseeko ftruncate geteuid getgid getuid \
+ getpwuid gettimeofday lstat memcpy memset mkstemp rand seteuid \
+ setegid snprintf setenv strndup unsetenv tzset sleep _stati64 \
+ usleep vsnprintf readlink realpath gmtime_r localtime_r] )
# check for timegm() support
AC_CHECK_FUNC(timegm, AC_DEFINE(HAVE_TIMEGM,1,
--- a/lib/driver/_cdio_generic.c
+++ b/lib/driver/_cdio_generic.c
@@ -55,16 +55,6 @@
#define PATH_MAX 4096
#endif
-/* If available and LFS is enabled, try to use lseek64 */
-#if defined(HAVE_LSEEK64) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
-#if defined(_MSC_VER)
-#include <io.h>
-#endif
-#define CDIO_LSEEK lseek64
-#else
-#define CDIO_LSEEK lseek
-#endif
-
/*!
Eject media -- there's nothing to do here. We always return -2.
Should we also free resources?
@@ -170,7 +160,7 @@ off_t
cdio_generic_lseek (void *user_data, off_t offset, int whence)
{
generic_img_private_t *p_env = user_data;
- return CDIO_LSEEK(p_env->fd, offset, whence);
+ return lseek(p_env->fd, offset, whence);
}
/*!
--- a/lib/driver/_cdio_stdio.c
+++ b/lib/driver/_cdio_stdio.c
@@ -47,11 +47,7 @@
#include "_cdio_stdio.h"
#include "cdio_assert.h"
-/* On 32 bit platforms, fseek can only access streams of 2 GB or less.
- Prefer fseeko/fseeko64, that take a 64 bit offset when LFS is enabled */
-#if defined(HAVE_FSEEKO64) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
-#define CDIO_FSEEK fseeko64
-#elif defined(HAVE_FSEEKO)
+#if defined(HAVE_FSEEKO)
#define CDIO_FSEEK fseeko
#else
#define CDIO_FSEEK fseek