chflags: use Capsicum capability modeRun the file-hierarchy traversal inside Capsicum capability modeusing the fts_openat(3) API. This confines chflags to the directoryhierarchies named on the c
chflags: use Capsicum capability modeRun the file-hierarchy traversal inside Capsicum capability modeusing the fts_openat(3) API. This confines chflags to the directoryhierarchies named on the command line, so a malicious or buggy treecannot redirect it at files elsewhere via a crafted symbolic link.Because AT_FDCWD is rejected in capability mode, a directory descriptorfor the parent directory of every argument with an absolute path or apath containing ".." is opened once before cap_enter(). Once everydescriptor is open, cap_enter() is called and the traversal acts throughfd-relative operations: chflagsat(fts_parent->fts_dirfd, fts_name).With -L chflags follows symbolic links, which may point outside thenamed hierarchy; chflag now rejects such accesses. The new--dereference-links-unsafely option disables the sandbox to restore thehistorical behavior for the rare callers that rely on it. But if thesymbolic was link was named directly on the command line, chflags willstill follow it (unless -h was given).Add functional tests covering relative, absolute, "..", recursiveand mixed path arguments, and the symlink handling in both thedefault and --dereference-links-unsafely modes; they skip onfilesystems that do not support the uchg flag.Sponsored by: Google LLC (GSoC 2026)Reviewed by: asomersRelnotes: yes (for the -L behavior change)Pull Request: https://github.com/freebsd/freebsd-src/pull/2375
show more ...
Remove residual blank line at start of MakefileThis is a residual of the $FreeBSD$ removal.MFC After: 3 days (though I'll just run the command on the branches)Sponsored by: Netflix
Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
DIRDEPS_BUILD: Connect new directories.Sponsored by: Dell EMC Isilon
Add basic tests for chflags, mkdir, rcp, and rmdirAdd basic command line parsing test coverage for these utilities. The testswere automatically generated based on their man pages. These tests ca
Add basic tests for chflags, mkdir, rcp, and rmdirAdd basic command line parsing test coverage for these utilities. The testswere automatically generated based on their man pages. These tests can beexpanded by hand for more thorough coverage. The aim is to generate verybasic amount of test coverage for all the utilities in the base system.Submitted by: shivanshReviewed by: asomers, brooksMFC after: 3 weeksSponsored by: Google, Inc (GSoC 2017)Differential Revision: https://reviews.freebsd.org/D12036