Skip to content

chmod: --preserve-root can be bypassed with any directory that resolves to root #10018

Description

@sylvestre

Component

chmod

Description

--preserve-root can be bypassed with any directory that resolves to root.
In Chmoder::chmod()

            if self.recursive && self.preserve_root && file == Path::new("/") {
                return Err(ChmodError::PreserveRoot("/".to_string()).into());
            }

Test / Reproduction Steps

../target/release/chmod -R --preserve-root 000 /../ -v

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