Skip to content

readlink: traverse symlinks before resolving .. #9057

@bdrung

Description

@bdrung

The readlink command from GNU coreutils and the one from uutil coreutils behave differently in case the path contains symlinks and ... GNU readlink traverses symlinks first, but uutils resolves .. first.

Example from Ubuntu 25.10 (questing):

$ gnureadlink -f /sys/class/block/nvme0n1p1/..
/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/nvme/nvme0/nvme0n1
$ /usr/lib/cargo/bin/coreutils/readlink -f /sys/class/block/nvme0n1p1/..
/sys/class/block

This breaks dracut (see also dracut-ng/dracut-ng#1776).

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2134496

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions