[Bug 2148464] [NEW] chown ignores -h argument on symlinks to folders

Sven Nierlein 2148464 at bugs.launchpad.net
Wed Apr 15 12:30:45 UTC 2026


Public bug reported:

Using chown -h on symlinks to folders changes the destination instead of
the symlink:

It can be simply reproduced as follows:

root at ubuntu26-04-64:/tmp/chown-test #>mkdir destination

root at ubuntu26-04-64:/tmp/chown-test #>ln -s destination link

root at ubuntu26-04-64:/tmp/chown-test #>ls -la
total 0
drwxr-xr-x  3 root root  80 Apr 15 14:08 .
drwxrwxrwt 17 root root 340 Apr 15 13:39 ..
drwxr-xr-x  2 root root  40 Apr 15 14:08 destination
lrwxrwxrwx  1 root root   6 Apr 15 14:08 link -> destination

root at ubuntu26-04-64:/tmp/chown-test #>chown -h nobody:nogroup link

root at ubuntu26-04-64:/tmp/chown-test #>ls -la
total 0
drwxr-xr-x  3 root   root     80 Apr 15 14:08 .
drwxrwxrwt 17 root   root    340 Apr 15 13:39 ..
drwxr-xr-x  2 nobody nogroup  40 Apr 15 14:08 destination
lrwxrwxrwx  1 root   root      6 Apr 15 14:08 link -> destination

Instead of the destination, the link itself should be chowned.

It works fine for symlinks to files, but fails on symlinks to folders.

root at ubuntu26-04-64:/tmp/chown-test #>type chown
chown is hashed (/usr/bin/chown)

root at ubuntu26-04-64:/tmp/chown-test #>readelf -n /usr/bin/chown
...
Displaying notes found in: .note.package
  Owner                Data size    Description
  FDO                  0x00000068   FDO_PACKAGING_METADATA
    Packaging Metadata: {"type":"deb","os":"ubuntu","name":"rust-coreutils","version":"0.7.0-0ubuntu1","architecture":"amd64"}

** Affects: rust-coreutils (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to rust-coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/2148464

Title:
  chown ignores -h argument on symlinks to folders

Status in rust-coreutils package in Ubuntu:
  New

Bug description:
  Using chown -h on symlinks to folders changes the destination instead
  of the symlink:

  It can be simply reproduced as follows:

  root at ubuntu26-04-64:/tmp/chown-test #>mkdir destination

  root at ubuntu26-04-64:/tmp/chown-test #>ln -s destination link

  root at ubuntu26-04-64:/tmp/chown-test #>ls -la
  total 0
  drwxr-xr-x  3 root root  80 Apr 15 14:08 .
  drwxrwxrwt 17 root root 340 Apr 15 13:39 ..
  drwxr-xr-x  2 root root  40 Apr 15 14:08 destination
  lrwxrwxrwx  1 root root   6 Apr 15 14:08 link -> destination

  root at ubuntu26-04-64:/tmp/chown-test #>chown -h nobody:nogroup link

  root at ubuntu26-04-64:/tmp/chown-test #>ls -la
  total 0
  drwxr-xr-x  3 root   root     80 Apr 15 14:08 .
  drwxrwxrwt 17 root   root    340 Apr 15 13:39 ..
  drwxr-xr-x  2 nobody nogroup  40 Apr 15 14:08 destination
  lrwxrwxrwx  1 root   root      6 Apr 15 14:08 link -> destination

  Instead of the destination, the link itself should be chowned.

  It works fine for symlinks to files, but fails on symlinks to folders.

  root at ubuntu26-04-64:/tmp/chown-test #>type chown
  chown is hashed (/usr/bin/chown)

  root at ubuntu26-04-64:/tmp/chown-test #>readelf -n /usr/bin/chown
  ...
  Displaying notes found in: .note.package
    Owner                Data size    Description
    FDO                  0x00000068   FDO_PACKAGING_METADATA
      Packaging Metadata: {"type":"deb","os":"ubuntu","name":"rust-coreutils","version":"0.7.0-0ubuntu1","architecture":"amd64"}

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2148464/+subscriptions





More information about the foundations-bugs mailing list