Compare commits

...

No commits in common. 'c9' and 'c10-beta' have entirely different histories.
c9 ... c10-beta

@ -0,0 +1,68 @@
From f88ec3114dfdb5f284367d7602a06dc021409616 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Fri, 26 Jan 2024 10:36:07 +0100
Subject: [PATCH] Fix formatting a trailing backslash and a percent sign
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
There was a bug report that a trailing backslash leads to printing
a nul byte and an commandline:
$ /usr/bin/time -f 'abc\' sleep 1 2>&1 | hexdump -vC
00000000 61 62 63 3f 5c 00 73 6c 65 65 70 0a |abc?\.sleep.|
0000000c
This patch fixes it.
A similar fix was already in place for a trailing percent sign, but it
was missing printing an implicit newline as mandated by
the documentation. This patch fixes it either.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
src/time.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/time.c b/src/time.c
index 2f2b702..2184e4e 100644
--- a/src/time.c
+++ b/src/time.c
@@ -585,12 +585,13 @@ summarize (fp, fmt, command, resp)
break;
case '\0':
putc ('?', fp);
- return;
+ break;
default:
putc ('?', fp);
putc (*fmt, fp);
}
- ++fmt;
+ if (*fmt != '\0')
+ ++fmt;
break;
case '\\': /* Format escape. */
@@ -605,12 +606,17 @@ summarize (fp, fmt, command, resp)
case '\\':
putc ('\\', fp);
break;
+ case '\0':
+ putc ('?', fp);
+ putc ('\\', fp);
+ break;
default:
putc ('?', fp);
putc ('\\', fp);
putc (*fmt, fp);
}
- ++fmt;
+ if (*fmt != '\0')
+ ++fmt;
break;
default:
--
2.43.0

@ -0,0 +1,11 @@
diff --color -ruN time-1.9.orig/Makefile.am time-1.9/Makefile.am
--- time-1.9.orig/Makefile.am 2017-11-08 16:31:54.000000000 -0500
+++ time-1.9/Makefile.am 2023-06-28 13:26:45.271212609 -0400
@@ -74,7 +74,6 @@
TESTS = tests/help-version.sh \
- tests/time-max-rss.sh \
tests/time-exit-codes.sh \
tests/time-posix-quiet.sh

@ -1,44 +1,45 @@
Summary: A GNU utility for monitoring a program's use of system resources
Name: time
Version: 1.9
Release: 18%{?dist}
# src/time.c: GPLv3+
# COPYING: GPLv3 text
# doc/time.texi: GFDL
# doc/fdl.texi: GFDL 1.3 text
# doc/time.info: GFDL
# lib/stdnoreturn.in.h: GPLv3+
# lib/strerror-override.c: GPLv3+
# lib/error.h: GPLv3+
Release: 24%{?dist}
# src/time.c: GPL-3.0-or-later
# COPYING: GPL-3.0 text
# doc/time.texi: GFDL-1.3-no-invariants-or-later
# doc/fdl.texi: GFDL-1.3 text
# doc/time.info: GFDL-1.3-no-invariants-or-later
# lib/stdnoreturn.in.h: GPL-3.0-or-later
# lib/strerror-override.c: GPL-3.0-or-later
# lib/error.h: GPL-3.0-or-later
## Not in a binary package
# tests/init.sh: GPLv3+
# tests/init.sh: GPL-3.0-or-later
# INSTALL: FSFAP
# configure: FSFUL
# build-aux/config.guess: GPLv3+ with exceptions
# build-aux/install-sh: MIT and Public Domain
# build-aux/config.guess: GPL-3.0-or-later WITH Autoconf-exception-generic
# build-aux/install-sh: X11 AND LicenseRef-Fedora-Public-Domain
# build-aux/config.rpath: FSFULLR
# build-aux/test-driver: GPLv2+ with exceptions
# build-aux/update-copyright: GPLv3+
# build-aux/useless-if-before-free: GPLv3+
# build-aux/vc-list-files: GPLv3+
# build-aux/missing: GPLv2+ with exceptions
# build-aux/compile: GPLv2+ with exceptions
# build-aux/config.sub: GPLv3+ with exceptions
# build-aux/gitlog-to-changelog: GPLv3+
# build-aux/git-version-gen: GPLv3+
# build-aux/texinfo.tex: GPLv3+ with exceptions
# build-aux/depcomp: GPLv2+ with exceptions
# build-aux/mdate-sh: GPLv2+ with exceptions
# GNUmakefile: GPLv3+
# build-aux/test-driver: GPL-2.0-or-later WITH Autoconf-exception-generic
# build-aux/update-copyright: GPL-3.0-or-later
# build-aux/useless-if-before-free: GPL-3.0-or-later
# build-aux/vc-list-files: GPL-3.0-or-later
# build-aux/missing: GPL-2.0-or-later WITH Autoconf-exception-generic
# build-aux/compile: GPL-2.0-or-later WITH Autoconf-exception-generic
# build-aux/config.sub: GPL-3.0-or-later WITH Autoconf-exception-generic
# build-aux/gitlog-to-changelog: GPL-3.0-or-later
# build-aux/git-version-gen: GPL-3.0-or-later
# build-aux/texinfo.tex: GPL-3.0-or-later WITH Texinfo-exception AND GPL-1.0-or-later
# build-aux/depcomp: GPL-2.0-or-later WITH Autoconf-exception-generic
# build-aux/mdate-sh: GPL-2.0-or-later WITH Autoconf-exception-generic
# GNUmakefile: GPL-3.0-or-later
# m4/asm-underscore.m4: FSFULLR
# m4/gnulib-cache.m4: GPLv3+ with exceptions
# m4/gnulib-cache.m4: GPL-3.0-or-later WITH Autoconf-exception-generic
# m4/host-cpu-c-abi.m4: FSFULLR
# m4/longlong.m4: FSFULLR
# m4/ssize_t.m4: FSFULLR
# m4/stdnoreturn.m4: FSFULLR
# maint.mk: GPLv3+
# tests/time-posix-quiet.sh: GPLv3+
License: GPLv3+ and GFDL
# maint.mk: GPL-3.0-or-later
# tests/time-posix-quiet.sh: GPL-3.0-or-later
License: GPL-3.0-or-later AND GFDL-1.3-no-invariants-or-later
SourceLicense: %{license} AND GPL-3.0-or-later WITH Autoconf-exception-generic AND GPL-3.0-or-later WITH Texinfo-exception AND GPL-2.0-or-later WITH Autoconf-exception-generic AND GPL-1.0-or-later AND X11 AND FSFAP AND FSFUL AND FSFULLR AND LicenseRef-Fedora-Public-Domain
Url: https://www.gnu.org/software/%{name}/
Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz
Source1: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz.sig
@ -56,6 +57,13 @@ Patch2: time-1.9-Use-kibibytes-instead-of-kilobytes-in-a-documentatio.patch
# proposed to an upstream,
# <https://lists.gnu.org/archive/html/bug-time/2020-11/msg00001.html>
Patch3: time-1.9-Close-outfp-before-exec.patch
# The time-max-rss.sh test randomly fails( mallocating 5 MB more does not have
# to increase RSS in 5 MB). In addition there is regression in ppc64le kernel
# (bug #2212765) which always fails.
Patch4: time-1.9-drop-flawed-rss-test.patch
# Fix formatting a trailing backslash, proposed to the upstream,
# <https://lists.gnu.org/archive/html/bug-time/2024-01/msg00000.html>
Patch5: time-1.9-Fix-formatting-a-trailing-backslash-and-a-percent-si.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bash
@ -74,12 +82,14 @@ the results.
%prep
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch -P0 -p1
%patch -P1 -p1
%patch -P2 -p1
# Set time stamp stored in an info page to the latest patch
touch -d "$(sed -n -e '/^Date: /{s/^[^:]*: //;p}' %{PATCH2})" doc/time.texi
%patch3 -p1
%patch -P3 -p1
%patch -P4 -p1
%patch -P5 -p1
# Correct version VERSION flag for doc/time.texi
# <https://lists.gnu.org/archive/html/bug-time/2021-01/msg00000.html>
printf '%{version}\n' > .tarball-version
@ -105,12 +115,29 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir
# time(1) manual page lives in man-pages package, bug #1612294.
%changelog
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.9-18
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com>
- Bump release for June 2024 mass rebuild
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.9-17
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Fri Jan 26 2024 Petr Pisar <ppisar@redhat.com> - 1.9-23
- Fix formatting a trailing backslash
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jun 28 2023 Stephen Gallagher <sgallagh@redhat.com> - 1.9-21
- Tests: drop time-max-rss.sh test (bug #2212765)
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

Loading…
Cancel
Save