all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#68813] [PATCH 1/5] gnu: Add atf.
@ 2024-01-30  4:26 Maxim Cournoyer
  2024-02-22 16:09 ` [bug#68813] [core-updates PATCH 00/20] Replace pkg-config with pkgconf to reduce propagation / Inkscape updates Maxim Cournoyer
  0 siblings, 1 reply; 26+ messages in thread
From: Maxim Cournoyer @ 2024-01-30  4:26 UTC (permalink / raw)
  To: 68813; +Cc: Maxim Cournoyer

* gnu/packages/check.scm (atf): New variable.
* gnu/packages/patches/atf-execute-with-shell.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.

Change-Id: I37a57069380309382bc0ff24977a1fd165985f5e
---

 gnu/local.mk                                  |  3 +-
 gnu/packages/check.scm                        | 40 ++++++++++++++++++-
 .../patches/atf-execute-with-shell.patch      | 39 ++++++++++++++++++
 3 files changed, 80 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/atf-execute-with-shell.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8170ba6b83..69bf23c89e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -19,7 +19,7 @@
 # Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
 # Copyright © 2018, 2019, 2020, 2021, 2022 Oleg Pykhalov <go.wigust@gmail.com>
 # Copyright © 2018 Stefan Stefanović <stefanx2ovic@gmail.com>
-# Copyright © 2018, 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+# Copyright © 2018, 2020, 2021, 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 # Copyright © 2019, 2020, 2021, 2022, 2044 Guillaume Le Vaillant <glv@posteo.net>
 # Copyright © 2019, 2020 John Soo <jsoo1@asu.edu>
 # Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
@@ -931,6 +931,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/asli-use-system-libs.patch		\
   %D%/packages/patches/aspell-CVE-2019-25051.patch		\
   %D%/packages/patches/aspell-default-dict-dir.patch		\
+  %D%/packages/patches/atf-execute-with-shell.patch		\
   %D%/packages/patches/ath9k-htc-firmware-binutils.patch	\
   %D%/packages/patches/ath9k-htc-firmware-gcc.patch		\
   %D%/packages/patches/ath9k-htc-firmware-gcc-compat.patch	\
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 4de5b1c0d4..bc2abf2bc0 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -35,7 +35,7 @@
 ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com>
 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
-;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020, 2021, 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr>
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2022, 2023 David Elsing <david.elsing@posteo.net>
@@ -111,6 +111,44 @@ (define-module (gnu packages check)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public atf
+  (package
+    (name "atf")
+    (version "0.21")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/freebsd/atf")
+                    (commit (string-append name "-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0jwzz6g9jdi5f8v10y0wf3hq73vxyv5qqhkh832ddsj36gn8rlcz"))
+              (patches (search-patches "atf-execute-with-shell.patch"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:configure-flags
+           #~(list (string-append "ATF_SHELL="
+                                  #$(this-package-input "bash-minimal")
+                                  "/bin/sh"))))
+    (native-inputs (list autoconf automake libtool))
+    (inputs (list bash-minimal))
+    (home-page "https://github.com/freebsd/atf")
+    (synopsis "C/C++ Automated Testing Framework libraries")
+    (description "ATF, or Automated Testing Framework, is a collection of
+libraries to write test programs in C, C++ and POSIX shell.
+
+The ATF libraries offer a simple API.  The API is orthogonal through the
+various bindings, allowing developers to quickly learn how to write test
+programs in different languages.
+
+ATF-based test programs offer a consistent end-user command-line interface to
+allow both humans and automation to run the tests.
+
+ATF-based test programs rely on an execution engine to be run and this
+execution engine is not shipped with ATF.  Kyua is the engine of choice.")
+    (license (list license:bsd-2 license:bsd-3))))
+
 (define-public pict
   (package
     (name "pict")
diff --git a/gnu/packages/patches/atf-execute-with-shell.patch b/gnu/packages/patches/atf-execute-with-shell.patch
new file mode 100644
index 0000000000..bde4fb336a
--- /dev/null
+++ b/gnu/packages/patches/atf-execute-with-shell.patch
@@ -0,0 +1,39 @@
+Submitted here: https://github.com/freebsd/atf/pull/57
+
+From 098b66269b1cf1d944b8b214ceb7ce9febde3682 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Mon, 29 Jan 2024 22:35:49 -0500
+Subject: [PATCH] Fix use after free in execute_with_shell.
+
+The temporary string returned by atf::env::get would be used outside
+its statement, which is invalid and cause undefined behavior.  Copy it
+to a local variable to avoid the issue.
+
+Fixes: https://github.com/freebsd/atf/issues/26
+Fixes: https://github.com/freebsd/kyua/issues/223
+
+Reported-by: Ruslan Bukin <br@bsdpad.com>
+---
+ atf-sh/atf-check.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/atf-sh/atf-check.cpp b/atf-sh/atf-check.cpp
+index 41f0b13..9d6f7a8 100644
+--- a/atf-sh/atf-check.cpp
++++ b/atf-sh/atf-check.cpp
+@@ -436,7 +436,9 @@ execute_with_shell(char* const* argv)
+     const std::string cmd = flatten_argv(argv);
+ 
+     const char* sh_argv[4];
+-    sh_argv[0] = atf::env::get("ATF_SHELL", ATF_SHELL).c_str();
++    const std::string shell = atf::env::get("ATF_SHELL", ATF_SHELL);
++
++    sh_argv[0] = shell.c_str();
+     sh_argv[1] = "-c";
+     sh_argv[2] = cmd.c_str();
+     sh_argv[3] = NULL;
+
+base-commit: 18eb8168b70a0f934b4824b6391b55ac0b2f4fdf
+-- 
+2.41.0
+

base-commit: 6573a72cdadebdf802ec7383253e44b975833895
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2024-03-09 18:34 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-30  4:26 [bug#68813] [PATCH 1/5] gnu: Add atf Maxim Cournoyer
2024-02-22 16:09 ` [bug#68813] [core-updates PATCH 00/20] Replace pkg-config with pkgconf to reduce propagation / Inkscape updates Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 02/20] gnu: Add lutok Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 03/20] gnu: Add kyua Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 04/20] gnu: pkgconf: Enable test suite Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 05/20] gnu: Add pkgconf-as-pkg-config Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 06/20] gnu: pkgconf: Add $PKG_CONFIG_PATH search path Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 07/20] gnu: pkgconf: Add support for cross-compilation Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 08/20] gnu: pkg-config: Alias to pkgconf-as-pkg-config Maxim Cournoyer
2024-02-24 11:41     ` Ludovic Courtès
2024-02-24 20:34       ` Maxim Cournoyer
2024-02-24 22:33         ` Ludovic Courtès
2024-03-09 18:32           ` bug#68813: [PATCH core-updates] Replace pkg-config with pkgconf to reduce propagation / Inkscape updates Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 09/20] gnu: pstoedit: Update to 4.00 Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 10/20] gnu: autotrace: Update to 0.31.10 Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 11/20] gnu: autotrace: Remove libtool archives Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 12/20] gnu: autotrace: Fix pkg-config file Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 13/20] gnu: gd: Update to 2.3.3 Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 14/20] gnu: lib2geom: Update to 1.3 Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 15/20] gnu: inkscape: Truly enable ImageMagic support Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 16/20] gnu: lib2geom: Use gexps and remove input labels Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 17/20] gnu: inkscape: Update to 1.3.2 Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 18/20] gnu: inkscape: Sort inputs Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 19/20] gnu: inkscape: Fix Python support Maxim Cournoyer
2024-02-22 16:10   ` [bug#68813] [core-updates PATCH 20/20] Revert "gnu: mpv: Propagate most libraries." Maxim Cournoyer
2024-02-22 16:29   ` [bug#68813] [core-updates PATCH 01/20] gnu: Add atf Maxim Cournoyer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.