Your message dated Thu, 25 Feb 2021 11:03:45 +0000
with message-id <[email protected]>
and subject line Bug#982423: fixed in reprepro 5.3.0-1.2
has caused the Debian Bug report #982423,
regarding reprepro: Does not write to pipe if --endhook is set
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
982423: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982423
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: reprepro
Version: 5.3.0-1.1
Severity: important
Tags: patch
X-Debbugs-Cc: none, Hilko Bengen <[email protected]>
Dear Maintainer,
when used with --endhook, reprepro fails to output anything if standard
output is a pipe. Here's a minimal reproducer:
,----
| $ mkdir -p r/conf
| $ cat > r/conf/distributions <<EOF
| Codename: sid
| Architectures: amd64 source
| Components: main
| EOF
| $ reprepro -b r includedsc sid hello_2.10-2.dsc
| Exporting indices...
| $ reprepro -b r list sid
| sid|main|source: hello 2.10-2
| $ reprepro -b r list sid | cat
| sid|main|source: hello 2.10-2
| $ reprepro -b r --endhook /bin/true list sid | cat
| $
`----
Apparently stdio buffers are not flushed before exec()ing the endhook
program. The attached patch fixes this.
Cheers,
-Hilko
>From 14c3140374e3cf815bda060d5e4e668484b92791 Mon Sep 17 00:00:00 2001
From: Hilko Bengen <[email protected]>
Date: Wed, 10 Feb 2021 01:47:23 +0100
Subject: [PATCH] Flush stdout, stderr before calling endhook
---
main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/main.c b/main.c
index 31aa5cf..d6ee80d 100644
--- a/main.c
+++ b/main.c
@@ -4906,6 +4906,8 @@ static inline int callendhook(int status, char *argv[]) {
if (snprintf(exitcode, 4, "%u", ((unsigned int)status)&255U) > 3)
memcpy(exitcode, "255", 4);
sethookenvironment(causingfile, NULL, NULL, exitcode);
+ fflush(stdout);
+ fflush(stderr);
argv[0] = endhook,
(void)execv(endhook, argv);
fprintf(stderr, "Error executing '%s': %s\n", endhook,
--
2.30.0
--- End Message ---
--- Begin Message ---
Source: reprepro
Source-Version: 5.3.0-1.2
Done: Uwe Kleine-König <[email protected]>
We believe that the bug you reported is fixed in the latest version of
reprepro, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Uwe Kleine-König <[email protected]> (supplier of updated reprepro package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Thu, 18 Feb 2021 10:25:24 +0100
Source: reprepro
Architecture: source
Version: 5.3.0-1.2
Distribution: unstable
Urgency: medium
Maintainer: Bernhard R. Link <[email protected]>
Changed-By: Uwe Kleine-König <[email protected]>
Closes: 982423
Changes:
reprepro (5.3.0-1.2) unstable; urgency=medium
.
* Non-maintainer upload.
* Flush stdout and stderr before execv of an end hook (Closes: #982423)
Checksums-Sha1:
9a708750e29100c446ebd06dd5142ba4d3e2584f 1782 reprepro_5.3.0-1.2.dsc
48d95c63d718dcdd81bd3e867fb3e9e5f7f51994 13996 reprepro_5.3.0-1.2.debian.tar.xz
2e4cbba73e8ca1b4ba8353ca4a9a8a60d6427d28 6547
reprepro_5.3.0-1.2_amd64.buildinfo
Checksums-Sha256:
102c0a1653b671315c8bef8e0f91f1ceaa6a0a3607c567ca8f9c5cf2a05101b2 1782
reprepro_5.3.0-1.2.dsc
48bd2fde5b1673711b00ce08e5e13fd077f92deda13361b3976ae4fd5f8adac2 13996
reprepro_5.3.0-1.2.debian.tar.xz
956e5fcc33ddf391e52059f92f0ab5c8d60e564c0711954073d7d0120cbdf51e 6547
reprepro_5.3.0-1.2_amd64.buildinfo
Files:
d476326efe97d798516d0a6fc4d6b040 1782 utils optional reprepro_5.3.0-1.2.dsc
3a9b4b315a850dd4ac48219c307a1657 13996 utils optional
reprepro_5.3.0-1.2.debian.tar.xz
061f3f307bc76349b7d357a3599f2778 6547 utils optional
reprepro_5.3.0-1.2_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmAuO/MACgkQwfwUeK3K
7AkwHggAkX4iYIr+aYrQ/tq0I/jRUI6vqUn8K/bFn/wrWG6OHL42N/kUOjnZt3uo
xvV82Skx6uEznc1Q6qYZB0E+06F7Un6tM1gMJ01rXcqjzfVRIGMrzdOJFt1azOyJ
SIK3Q7ACvfxrU205z4SI5tYFTE2GkoNma24hGmFGYAMiYW6Ag3y+xtdV3BGvN8T3
u36D1STGuOFJIi3LKSMdVUZSqjtDBiXm9TA7dcUtP4rRyAwfvuuYW3QD4tq3EmXx
XPhL2fJCdkAJuKmzUW9hQMwHepTMdgVrS+ANQqmf6VIO6SI1yChXAn+OGCoxC3ih
YEIFQ3eCtNRCL9blSwf35jiJUKxi6w==
=qmMs
-----END PGP SIGNATURE-----
--- End Message ---