There's a bug with the -f option when used with the -v option, making you believe that it worked. To reproduce: ``` $ chflags -vf uchg /etc/passwd /etc/passwd $ echo $? 0 ``` Fix: https://github.com/freebsd/freebsd-src/pull/1088
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=fae467c2212ced8e82f5fa385d316445c8874941 commit fae467c2212ced8e82f5fa385d316445c8874941 Author: Ricardo Branco <rbranco@suse.de> AuthorDate: 2024-01-29 22:17:47 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-01-30 17:08:03 +0000 chflags(1): Fix -f option As stated in the man page, -f must not emit warning on error, and must not set the utility exit code. PR: 276723 Github PR: https://github.com/freebsd/freebsd-src/pull/1088 Reviewed by: imp, kib MFC after: 1 week bin/chflags/chflags.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=151495ac8ddeec3fed3c55963776699fde8c8c6b commit 151495ac8ddeec3fed3c55963776699fde8c8c6b Author: Ricardo Branco <rbranco@suse.de> AuthorDate: 2024-01-29 22:17:47 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-02-06 00:37:37 +0000 chflags(1): Fix -f option PR: 276723 (cherry picked from commit fae467c2212ced8e82f5fa385d316445c8874941) bin/chflags/chflags.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=19d960cedddd08b59fe193190744a36602e7e8d5 commit 19d960cedddd08b59fe193190744a36602e7e8d5 Author: Ricardo Branco <rbranco@suse.de> AuthorDate: 2024-01-29 22:17:47 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-02-06 00:38:34 +0000 chflags(1): Fix -f option PR: 276723 (cherry picked from commit fae467c2212ced8e82f5fa385d316445c8874941) bin/chflags/chflags.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
^Triage: assign to committer. All MFCs are done.