[packages/libcdio] - patches from Debian

hawk hawk at pld-linux.org
Wed May 1 13:30:13 CEST 2024


commit 2a79ea0297a6983bda83c2ecf7e3d5af31e8ceda
Author: Marcin Krol <hawk at tld-linux.org>
Date:   Wed May 1 13:29:43 2024 +0200

    - patches from Debian

 Correct-realpath-test-failure.patch                | 50 ++++++++++++++++
 ...O_SOURCE_PATH-by-dropping-STRIP_FROM_PATH.patch | 40 +++++++++++++
 Use-getmntent-setmntent-for-reading-mounts.patch   | 68 ++++++++++++++++++++++
 libcdio.spec                                       | 12 +++-
 ncursesw.patch                                     | 17 ++++++
 ...ayer.c-always-use-s-style-format-for-prin.patch | 49 ++++++++++++++++
 6 files changed, 235 insertions(+), 1 deletion(-)
---
diff --git a/libcdio.spec b/libcdio.spec
index 8860293..33a2896 100644
--- a/libcdio.spec
+++ b/libcdio.spec
@@ -14,12 +14,17 @@ Summary:	GNU Compact Disc Input, Output and Control Library
 Summary(pl.UTF-8):	Biblioteka GNU do obsługi wejścia, wyjścia i sterowania czytnikiem CD
 Name:		libcdio
 Version:	2.1.0
-Release:	1
+Release:	2
 License:	GPL v3+
 Group:		Libraries
 Source0:	http://ftp.gnu.org/gnu/libcdio/%{name}-%{version}.tar.bz2
 # Source0-md5:	aa7629e8f73662a762f64c444b901055
 Patch0:		%{name}-info.patch
+Patch1:		ncursesw.patch
+Patch2:		Drop-LIBCDIO_SOURCE_PATH-by-dropping-STRIP_FROM_PATH.patch
+Patch3:		src-cdda-player.c-always-use-s-style-format-for-prin.patch
+Patch4:		Correct-realpath-test-failure.patch
+Patch5:		Use-getmntent-setmntent-for-reading-mounts.patch
 URL:		http://www.gnu.org/software/libcdio/
 BuildRequires:	autoconf >= 2.61
 BuildRequires:	automake >= 1:1.8.3
@@ -144,6 +149,11 @@ Narzędzia używające libcdio: cd-info, cd-read.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 %{__sed} -i 's, example$,,' Makefile.am
 
diff --git a/Correct-realpath-test-failure.patch b/Correct-realpath-test-failure.patch
new file mode 100644
index 0000000..15bb8ff
--- /dev/null
+++ b/Correct-realpath-test-failure.patch
@@ -0,0 +1,50 @@
+From: "R. Bernstein" <rocky at gnu.org>
+Date: Wed, 24 Aug 2022 14:34:33 -0400
+Subject: Correct realpath test failure
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+See https://savannah.gnu.org/bugs/?62948
+Patch courtesy of Martin Liška <marxin>
+
+(cherry picked from commit 56335fff0f21d294cd0e478d49542a43e9495ed0)
+---
+ test/driver/realpath.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/test/driver/realpath.c b/test/driver/realpath.c
+index 289253e..cd46d62 100644
+--- a/test/driver/realpath.c
++++ b/test/driver/realpath.c
+@@ -1,5 +1,7 @@
+ /* -*- C -*-
+-  Copyright (C) 2010-2012, 2015, 2017 Rocky Bernstein <rocky at gnu.org>
++
++  Copyright (C) 2010-2012, 2015, 2017, 2022 Rocky Bernstein
++  <rocky at gnu.org>
+ 
+   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
+@@ -175,16 +177,17 @@ main(int argc, const char *argv[])
+         rc = check_rc(symlink(psz_symlink_file, psz_symlink_file),
+                       "symlink", psz_symlink_file);
+         if (0 == rc) {
+-            cdio_realpath(psz_symlink_file, psz_file_check);
+-            if (0 != strncmp(psz_file_check, symlink_file, PATH_MAX)) {
++            char *retvalue = cdio_realpath(psz_symlink_file, psz_file_check);
++            if (0 != retvalue) {
++	      if (0 != strncmp(psz_file_check, symlink_file, PATH_MAX)) {
+                 fprintf(stderr, "direct cdio_realpath cycle test failed. %s vs %s\n",
+                         psz_file_check, symlink_file);
+ 		rc = 5;
+ 		goto err_exit;
++	      }
++	      check_rc(unlink(psz_symlink_file), "unlink", psz_symlink_file);
+             }
+-            check_rc(unlink(psz_symlink_file), "unlink", psz_symlink_file);
+         }
+-
+     }
+ 
+     check_rc(unlink(psz_orig_file), "unlink", psz_orig_file);
diff --git a/Drop-LIBCDIO_SOURCE_PATH-by-dropping-STRIP_FROM_PATH.patch b/Drop-LIBCDIO_SOURCE_PATH-by-dropping-STRIP_FROM_PATH.patch
new file mode 100644
index 0000000..8b06628
--- /dev/null
+++ b/Drop-LIBCDIO_SOURCE_PATH-by-dropping-STRIP_FROM_PATH.patch
@@ -0,0 +1,40 @@
+From 08c1768aaeea86c522c0ef1705b9b6d434ebd3ae Mon Sep 17 00:00:00 2001
+From: Chris Lamb <chris at chris-lamb.co.uk>
+Date: Fri, 28 Jul 2017 11:49:13 +0100
+Subject: [PATCH] Drop LIBCDIO_SOURCE_PATH by dropping STRIP_FROM_PATH Doxygen
+ setup; it's not used as FULL_PATH_NAMES = no
+
+---
+ configure.ac            | 5 -----
+ doc/doxygen/Doxyfile.in | 2 +-
+ 2 files changed, 1 insertion(+), 6 deletions(-)
+
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -557,11 +557,6 @@ AC_SUBST(HAVE_SOLARIS_CDROM)
+ AC_SUBST(HAVE_WIN32_CDROM)
+ AC_SUBST(HAVE_OS2_CDROM)
+ 
+-LIBCDIO_SOURCE_PATH="`pwd`"
+-AC_DEFINE_UNQUOTED(LIBCDIO_SOURCE_PATH, "$LIBCDIO_SOURCE_PATH",
+-	[Full path to libcdio top_sourcedir.])
+-AC_SUBST(LIBCDIO_SOURCE_PATH)
+-
+ 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 \
+Index: b/doc/doxygen/Doxyfile.in
+===================================================================
+--- a/doc/doxygen/Doxyfile.in
++++ b/doc/doxygen/Doxyfile.in
+@@ -138,7 +138,7 @@ FULL_PATH_NAMES        = NO
+ # If left blank the directory from which doxygen is run is used as the
+ # path to strip.
+ 
+-STRIP_FROM_PATH        = @LIBCDIO_SOURCE_PATH@
++STRIP_FROM_PATH        =
+ 
+ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+ # the path mentioned in the documentation of a class, which tells
diff --git a/Use-getmntent-setmntent-for-reading-mounts.patch b/Use-getmntent-setmntent-for-reading-mounts.patch
new file mode 100644
index 0000000..764ee88
--- /dev/null
+++ b/Use-getmntent-setmntent-for-reading-mounts.patch
@@ -0,0 +1,68 @@
+From 0d550dc9307901edd817333a5b530241d08ad889 Mon Sep 17 00:00:00 2001
+From: Miguel Borges de Freitas <enen92 at kodi.tv>
+Date: Wed, 2 Feb 2022 20:47:02 +0000
+Subject: [PATCH] Use getmntent/setmntent for reading mounts
+
+Since fields in the mtab and fstab files are separated by
+whitespace, octal escapes are used to represent the characters
+space (\040), tab (\011), newline (\012), and backslash (\\) in
+those files when they occur in one of the four strings in a
+mntent structure.  The routines addmntent() and getmntent() will
+convert from string representation to escaped representation and
+back.  When converting from escaped representation, the sequence
+\134 is also converted to a backslash.
+---
+ lib/driver/gnu_linux.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/lib/driver/gnu_linux.c b/lib/driver/gnu_linux.c
+index 6a6aa4dd..dddf333c 100644
+--- a/lib/driver/gnu_linux.c
++++ b/lib/driver/gnu_linux.c
+@@ -672,13 +672,13 @@ static int is_mounted (const char * device, char * target) {
+   char real_device_1[PATH_MAX];
+   char real_device_2[PATH_MAX];
+ 
+-  char file_device[PATH_MAX];
+-  char file_target[PATH_MAX];
++  struct mntent *fs;
++
++  fp = setmntent("/proc/mounts", "r");
+ 
+-  fp = fopen ( "/proc/mounts", "r");
+   /* Older systems just have /etc/mtab */
+   if(!fp)
+-    fp = fopen ( "/etc/mtab", "r");
++    fp = setmntent("/etc/mtab", "r");
+ 
+   /* Neither /proc/mounts nor /etc/mtab could be opened, give up here */
+   if(!fp) return 0;
+@@ -691,19 +691,19 @@ static int is_mounted (const char * device, char * target) {
+ 
+   /* Read entries */
+ 
+-  while ( fscanf(fp, "%s %s %*s %*s %*d %*d\n", file_device, file_target) != EOF ) {
+-      if (NULL == cdio_realpath(file_device, real_device_2)) {
++  while ((fs = getmntent(fp)) != NULL) {
++      if (NULL == cdio_realpath(fs->mnt_fsname, real_device_2)) {
+           cdio_debug("Problems resolving device %s: %s\n",
+-                     file_device, strerror(errno));
++                     fs->mnt_fsname, strerror(errno));
+       }
+     if(!strcmp(real_device_1, real_device_2)) {
+-      strcpy(target, file_target);
+-      fclose(fp);
++      strcpy(target, fs->mnt_dir);
++      endmntent(fp);
+       return 1;
+     }
+ 
+   }
+-  fclose(fp);
++  endmntent(fp);
+   return 0;
+ }
+ 
+-- 
+2.30.2
+
diff --git a/ncursesw.patch b/ncursesw.patch
new file mode 100644
index 0000000..a0a8fca
--- /dev/null
+++ b/ncursesw.patch
@@ -0,0 +1,17 @@
+Description: Use ncursesw instead of ncurses
+
+diff --git a/configure.ac b/configure.ac
+index 5f9f9e78..7fcf6a64 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -668,8 +668,8 @@ fi
+ if test "x$enable_cdda_player" = "xyes"; then
+   PKG_CHECK_MODULES(CDDA_PLAYER, ncurses,
+                     [AC_DEFINE(HAVE_KEYPAD, [1], [Define this if your libcurses has keypad])],
+-                    [AC_CHECK_LIB(curses, keypad,
+-                                  [CDDA_PLAYER_LIBS="-lcurses"],
++                    [AC_CHECK_LIB(ncursesw, keypad,
++                                  [CDDA_PLAYER_LIBS="-lncursesw"],
+                                   [AC_MSG_WARN([Will not build cdda-player - did not find libncurses or libcurses])
+                                     enable_cdda_player=no])])
+ fi
diff --git a/src-cdda-player.c-always-use-s-style-format-for-prin.patch b/src-cdda-player.c-always-use-s-style-format-for-prin.patch
new file mode 100644
index 0000000..4d3c8ab
--- /dev/null
+++ b/src-cdda-player.c-always-use-s-style-format-for-prin.patch
@@ -0,0 +1,49 @@
+From 28bf7c73f30f9f7530cf752e31392991fdbc2f8c Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich at gmail.com>
+Date: Mon, 1 Nov 2021 08:00:30 +0000
+Subject: [PATCH] src/cdda-player.c: always use "%s"-style format for
+ printf()-style functions
+
+`ncuses-6.3` added printf-style function attributes and now makes
+it easier to catch cases when user input is used in palce of format
+string when built with CFLAGS=-Werror=format-security:
+
+    cdda-player.c:1032:31:
+      error: format not a string literal and no format arguments [-Werror=format-security]
+     1032 |         mvprintw(i_line++, 0, line);
+          |                               ^~~~
+
+Let's wrap all the missing places with "%s" format.
+---
+ src/cdda-player.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/cdda-player.c b/src/cdda-player.c
+index 69eddee1..8834d606 100644
+--- a/src/cdda-player.c
++++ b/src/cdda-player.c
+@@ -298,7 +298,7 @@ action(const char *psz_action)
+              psz_action);
+   else
+     snprintf(psz_action_line, sizeof(psz_action_line), "%s", "" );
+-  mvprintw(LINE_ACTION, 0, psz_action_line);
++  mvprintw(LINE_ACTION, 0, "%s", psz_action_line);
+   clrtoeol();
+   refresh();
+ }
+@@ -1029,10 +1029,10 @@ display_tracks(void)
+       }
+       if (sub.track == i) {
+         attron(A_STANDOUT);
+-        mvprintw(i_line++, 0, line);
++        mvprintw(i_line++, 0, "%s", line);
+         attroff(A_STANDOUT);
+       } else
+-        mvprintw(i_line++, 0, line);
++        mvprintw(i_line++, 0, "%s", line);
+       clrtoeol();
+     }
+   }
+-- 
+2.33.0
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libcdio.git/commitdiff/2a79ea0297a6983bda83c2ecf7e3d5af31e8ceda



More information about the pld-cvs-commit mailing list