#1152651 Upstream patch should be used for 'printenv' and 'env' quoting in 9.12

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
Collin Funk
Date:
2026-10-30 23:37:03 UTC
Severity:
normal
#1152651#5
Date:
2026-10-30 22:56:57 UTC
From:
To:
Hi,

For context, I co-maintain GNU coreutils upstream.

I see that Debian updated to coreutils-9.12. In it we made a quoting
change to 'env' and 'printenv' which were a bit too aggressive. A large
part of the rationale was improved robustness, avoiding applications
getting confused with environment variables that may have newlines or
other strange characters. Here is the pre-9.12 behavior:

    $ env -i ENV='hello'$'\n''FAKE_ENV=goodbye' env
    ENV=hello
    FAKE_ENV=goodbye

Here is the 9.12 behavior, making it clear that FAKE_ENV is not an
environment variable:

    $ env -i ENV='hello'$'\n''FAKE_ENV=goodbye' ~/.local/bin/env
    ENV='hello'$'\n''FAKE_ENV=goodbye'

However, this caused some issues that we did not foresee from our
scanning of Debian Code Search [1] [2].

I suggest applying a patch we made after the 9.12 release [3], which quotes
only when standard output is a terminal. This avoids the issues that
arose from the change in 9.12. Apologies for the additional work.

P.S., while you are there, I also suggest adding libcap-dev to the
Build-Depends. Currently, on Debian, the package is being built without
capability support since libsystemd, which coreutils depends on, no
longer brings in libcap as a dependency. I reported that, along with a
patch in 1150670 [4].

Collin

[1] https://lists.gnu.org/archive/html/coreutils/2026-09/msg00061.html
[2] https://lists.gnu.org/archive/html/coreutils/2026-09/msg00062.html
[3] https://github.com/coreutils/coreutils/commit/782a1e5bc2090212273bb731dceee2cc2a071e54.patch
[4] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1150670

#1152651#10
Date:
2026-10-30 23:16:47 UTC
From:
To:
Hi Collin,

thanks, I've just uploaded 9.12-0.3 with that.

indeed, thanks. I've also did that in 9.12-0.3.

Regards,
Daniel

#1152651#15
Date:
2026-10-30 23:35:19 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
coreutils, 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 1152651@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Baumann <daniel@debian.org> (supplier of updated coreutils 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 ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 31 Oct 2026 00:01:30 +0100
Source: coreutils
Architecture: source
Version: 9.12-0.3
Distribution: unstable
Urgency: medium
Maintainer: Michael Stone <mstone@debian.org>
Changed-By: Daniel Baumann <daniel@debian.org>
Closes: 1150670 1152651
Changes:
 coreutils (9.12-0.3) unstable; urgency=medium
 .
   * Non-maintainer upload.
   * Cherry-picking patch from upstream:
     - relax env,printenv: only quote when outputting to terminals
       [GH: 355] (Closes: #1152651).
   * Adding direct libcap-dev to build-depends to bring back building with
     capability support, was previously pulled in via libsystemd-dev, thanks to
     Collin Funk <collin.funk1@gmail.com> (Closes: #1150670).
   * Removed some useless whitespaces in packaging files at EOL.
Checksums-Sha1:
 fff9eb3d1ad82f196bef413273f82bce8f002a31 1334 coreutils_9.12-0.3.dsc
 8f0cb0d512acdd7daeb95cd31bc6484bbdeddeee 24700 coreutils_9.12-0.3.debian.tar.xz
 8823e47cf2a56da57f2e9c37adcb6352dc318c3d 6418 coreutils_9.12-0.3_amd64.buildinfo
Checksums-Sha256:
 fd78cf0700a2cc2637e75874c4791f0b393de0220779cb0ca1a6edb5819be2e8 1334 coreutils_9.12-0.3.dsc
 ea542e19b43876749bac120a0fdc81d8e89a079441a4f6a72fd4b073cc842c11 24700 coreutils_9.12-0.3.debian.tar.xz
 9e16a34ddf53a034ebe103e933dec0a78c51c080c9c442b419d05283d6baab56 6418 coreutils_9.12-0.3_amd64.buildinfo
Files:
 5441d66caea08d60c5bf74ff910e0c66 1334 utils optional coreutils_9.12-0.3.dsc
 21b97a0ea5fd066bf99869f1b4eb3e92 24700 utils optional coreutils_9.12-0.3.debian.tar.xz
 0c5031a66f9a8b5cfe761897c7a6b4c3 6418 utils optional coreutils_9.12-0.3_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQQmmGg4gLaoSj0ERgL7tPDoCoAiLwUCauUlBAAKCRD7tPDoCoAi
L+h3AQD/QNH4tmiYIENasNgCu0JVLPesNp8xL/b5NF39N5QOPgD/S6G5H8Cw+/yb
7Y0+XVCUJwLGnNVvVWUFF4Heel3+UAo=
=7O7a
-----END PGP SIGNATURE-----