Bug 276723 - chflags: Fix -f option
Summary: chflags: Fix -f option
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Konstantin Belousov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-29 22:19 UTC by Ricardo Branco
Modified: 2024-02-08 02:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo Branco 2024-01-29 22:19:59 UTC
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
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-01-30 17:11:26 UTC
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(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-02-06 00:39:12 UTC
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(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-02-06 00:40:14 UTC
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(-)
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2024-02-08 02:43:26 UTC
^Triage: assign to committer.  All MFCs are done.