uutils / uutils/coreutils

chown does not check for symlinks pointing to root when recursing through a tree

Open
#1,709 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - chown
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Even if the --preserve-root option is set the chown command will attempt to follow a symlink pointing to root. This can be seen with the following test:

mkdir point-to-root
ln -s / point-to-root/root
chown -RHh --preserve-root 1000 point-to-root/

The GNU chown will exit immediately, while this chown will follow the symlink and start trying to change root.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided chown command with --preserve-root, -R, -H, and -h, then trace the recursive symlink handling and root-preservation checks in the chown implementation. Done means the command detects the symlink to /, exits without attempting to change files under root, and matches the GNU chown behavior described.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.