🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #557

Bug#1150670: coreutils: ls is not linked against libcap

#557
From: Collin Funk
Date: Mon, 12 Oct 2026 03:40
98 lines
6244 bytes
Package: coreutils
Version: 9.10-1
Severity: normal
Tags: patch
X-Debbugs-Cc: collin.funk1@gmail.com

Hi Michael,

I noticed that in Debian Forky, ‘ls’ from GNU coreutils is not linked to
libcap:

    $ podman run --rm -it debian:forky
    $ { apt update -y && apt upgrade -y \
        && apt install -y binutils; } >/dev/null 2>&1
    $ readelf -d /usr/bin/ls | grep -F NEEDED
     0x0000000000000001 (NEEDED)             Shared library: [libselinux.so.1]
     0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

In Debian Trixie it is:

    $ podman run --rm -it debian:trixie
    $ { apt update -y && apt upgrade -y \
        && apt install -y binutils; } >/dev/null 2>&1
    $ readelf -d /usr/bin/ls | grep -F NEEDED
     0x0000000000000001 (NEEDED)             Shared library: [libselinux.so.1]
     0x0000000000000001 (NEEDED)             Shared library: [libcap.so.2]
     0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

GNU coreutils' 'ls' uses this to color files with capabilities set. It
appears that the coreutils package never had libcap-dev listed in
Build-Depends. In Trixie, it was brought in through the libsystemd
dependency. We can see that it depends on libcap in Trixie [1]. However,
in Forky the dependency was dropped [2], causing GNU coreutils to be
built without support for capabilities.

I confirmed this using an unstable sbuild chroot. Here is the relevant
output from ./configure before making any changes to the source package:

    checking for cap_get_file in -lcap... no
    configure: WARNING: libcap library was not found or not usable.
    configure: WARNING: GNU coreutils will be built without capability support.

Here we can see that ‘ls’ from the just-built package is missing a
libcap dependency:

    $ dpkg-deb -x coreutils_9.10-1_amd64.deb out
    $ readelf -d out/usr/bin/ls | grep -F NEEDED
     0x0000000000000001 (NEEDED)             Shared library: [libselinux.so.1]
     0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

I wrote the following patch and then bumped the version number:

$ diff -u debian/control.orig debian/control
--- debian/control.orig	2026-10-11 19:14:52.598734877 -0700
+++ debian/control	2026-10-11 19:15:49.163618195 -0700
@@ -2,7 +2,7 @@
 Maintainer: Michael Stone <mstone@debian.org>
 Section: utils
 Standards-Version: 4.7.3
-Build-Depends: gettext (>= 0.10.37), debhelper-compat (= 13), texinfo (>= 4.2) <!nodoc>, libattr1-dev [linux-any], libacl1-dev [linux-any], libselinux-dev [linux-any], gperf, bison, libgmp3-dev, libssl-dev, libsystemd-dev
+Build-Depends: gettext (>= 0.10.37), debhelper-compat (= 13), texinfo (>= 4.2) <!nodoc>, libattr1-dev [linux-any], libacl1-dev [linux-any], libselinux-dev [linux-any], gperf, bison, libgmp3-dev, libssl-dev, libsystemd-dev, libcap-dev
 
 Package: coreutils
 Architecture: any

Here is the relevant output from ./configure with those changes:

    checking for cap_get_file in -lcap... yes
    checking for sys/capability.h... yes

Here we can see that ‘ls’ from the just-built package has the libcap
dependency:

    $ dpkg-deb -x coreutils_9.10-1.1_amd64.deb out
    $ readelf -d out/usr/bin/ls | grep -F NEEDED
     0x0000000000000001 (NEEDED)             Shared library: [libselinux.so.1]
     0x0000000000000001 (NEEDED)             Shared library: [libcap.so.2]
     0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

Thanks,
Collin

[1] https://packages.debian.org/trixie/libsystemd0
[2] https://packages.debian.org/forky/libsystemd0
Technical Details
Message-ID: <NNf3j-508L-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer04.iad!feed-me.highwinds-media.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!nntp.comgw.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer04.iad!feed-me.highwinds-media.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!nntp.comgw.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Collin Funk <collin.funk1@gmail.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1150670: coreutils: ls is not linked against libcap
Date: Mon, 12 Oct 2026 05:40:01 +0200
Message-ID: <NNf3j-508L-3@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Mon Oct 12 03:33:11 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: 1.965
Reply-To: Collin Funk <collin.funk1@gmail.com>, 1150670@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: collin.funk1@gmail.com, mstone@debian.org
X-Debian-Pr-Message: report 1150670
X-Debian-Pr-Package: coreutils
X-Debian-Pr-Keywords: patch
X-Debian-Pr-Source: coreutils, coreutils-from
X-Gm-Message-State: AFq9FYK3imwG0EDXfCthSbkucxCDPhOxh5/QOjhp926tyE0uA8TL2B7b
	QXAHOZ+ZbTz8Z3drRgolPnijoim3FTtFqoBeKtkztMdAVEtPLjQLAfdelVlgDQ==
X-Gm-Gg: AYBFou384e7vkZieurmB/gyWFA0fxUgDMBgLDbupzG9yeAQNDt1afnY0E0iavm/+Og6
	zpnNt/bdnR7XNSa1TGX5+cn3SP+ziWXiKGZKRsDnEdKnzI7MdMysyeMjdUplqKLstOBwVnuSlQy
	hyd8ES8sbzpNuqrmeq/0OWNMyIQ5G6gKBWee8H1BCfzGA7v3GbGjtoxYcMWg5YAUg4j/G/TJGUU
	VvnTxzkar6KeJujt7DPBk359SJOGEfVa5YEHnJDrheTVYVouykyDI/GgnCQuB/FNBtyD770Ghj/
	P6spz1EiyHBm5hH6AmbMzsJKv+8sMeJ3Las5f8UIBsHurlUkxwb3Sgd3UwpTedhfL16mdQ88rOl
	VoQSNEmIRX2eYgh7eHSUBr9vtqDtOLWJay3bAK48ACG53Y+RSKyUg67RSi1kl6SUvdFv3iTJO/I
	AguLH9lzi4iAgy5tJSFCt+L0dEKtL1oKl3CZfNKLiVtgXoGjchibf1
X-Received: by 2002:a05:693c:8948:10b0:35b:244b:ca8c with SMTP id 5a478bee46e88-35b244bddffmr735634eec.33.1791775833624;
        Sun, 11 Oct 2026 20:30:33 -0700 (PDT)
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1996345
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 98
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Sun, 11 Oct 2026 20:30:31 -0700
X-Original-Message-ID: <87mrsjppd4.fsf@gmail.com>
X-Received-Bytes: 6038