import scl-utils-2.0.3-4.el9

This commit is contained in:
CentOS Sources 2023-03-28 12:05:05 +00:00 committed by Stepan Oksanichenko
parent aed5413e1f
commit 2c67254725
3 changed files with 91 additions and 1 deletions

View File

@ -0,0 +1,61 @@
From 9147d3b66e0a263c2eb427b7892b34c925363854 Mon Sep 17 00:00:00 2001
From: Michal Domonkos <mdomonko@redhat.com>
Date: Thu, 17 Feb 2022 17:36:00 +0100
Subject: [PATCH] Don't error out when command receives SIGINT
Interrupting a running command isn't really an execution problem so
don't print an error or return a non-zero exit status.
This is also how it worked in versions older than 2.0.
Resolves: rhbz#1967686
---
src/fallback.c | 3 +++
src/scllib.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/src/fallback.c b/src/fallback.c
index 4b9c8fd..c907a34 100644
--- a/src/fallback.c
+++ b/src/fallback.c
@@ -6,6 +6,7 @@
#include <errno.h>
#include <sys/stat.h>
#include <dirent.h>
+#include <signal.h>
#include "scllib.h"
#include "sclmalloc.h"
@@ -229,6 +230,8 @@ scl_rc fallback_run_command(char * const colnames[], const char *cmd, bool exec)
xasprintf(&bash_cmd, "/bin/bash %s", tmp);
status = system(bash_cmd);
if (status == -1 || !WIFEXITED(status)) {
+ if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
+ goto exit;
debug("Problem with executing command \"%s\"\n", bash_cmd);
ret = ERUN;
goto exit;
diff --git a/src/scllib.c b/src/scllib.c
index a182194..2ba8df8 100644
--- a/src/scllib.c
+++ b/src/scllib.c
@@ -11,6 +11,7 @@
#include <rpm/rpmcli.h>
#include <errno.h>
#include <wordexp.h>
+#include <signal.h>
#include "config.h"
#include "errors.h"
@@ -341,6 +342,8 @@ scl_rc run_command(char * const colnames[], const char *cmd, bool exec)
status = system(cmd);
if (status == -1 || !WIFEXITED(status)) {
+ if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
+ goto exit;
debug("Problem with executing program \"%s\"\n", cmd);
ret = ERUN;
goto exit;
--
2.35.1

View File

@ -0,0 +1,21 @@
From 864844ecc11f8cf65cd97bcffdb803211f7edaa4 Mon Sep 17 00:00:00 2001
From: Piotr Wilkosz <piotr.wilkosz@gmail.com>
Date: Mon, 23 May 2022 16:14:13 +0200
Subject: [PATCH] remove tmp file at exit
---
src/fallback.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/fallback.c b/src/fallback.c
index c907a34..e67654a 100644
--- a/src/fallback.c
+++ b/src/fallback.c
@@ -246,6 +246,7 @@ scl_rc fallback_run_command(char * const colnames[], const char *cmd, bool exec)
enable_path = _free(enable_path);
colpath = _free(colpath);
bash_cmd = _free(bash_cmd);
+ unlink(tmp);
return ret;
}

View File

@ -4,7 +4,7 @@
Name: scl-utils
Epoch: 1
Version: 2.0.3
Release: 2%{?dist}
Release: 4%{?dist}
Summary: Utilities for alternative packaging
License: GPLv2+
@ -18,6 +18,8 @@ BuildRequires: libcmocka libcmocka-devel environment-modules
Requires: %{_bindir}/modulecmd
Patch1: 0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch
Patch2: BZ-2056462-do-not-error-out-on-SIGINT.patch
Patch3: BZ-2091000-remove-tmp-file.patch
%description
Run-time utility for alternative packaging.
@ -80,6 +82,12 @@ make check
%{_rpmconfigdir}/brp-scl-python-bytecompile
%changelog
* Tue Dec 13 2022 Florian Festi <ffesti@redhat.com> - 1:2.0.3-4
- Remove tmp file (#2151261)
* Mon Feb 21 2022 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.3-3
- Don't error out when command receives SIGINT (#2056462)
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1:2.0.3-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688