daemon: Add option for output file mode
The daemon utility has always created its output file with a fixed mode
of 0600. This causes issues for log collection setups where the collector
does not run as root but instead relies on group access to the watched
daemon’s log file.
Introduce a new option that allows specifying the output file mode using
install(1)-style semantics. This enables non-root log collectors to access
the file as intended and improves compatibility with log rotation tools.
Reviewed by: kevans
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D54930
(cherry picked from commit a3b90a1f008365d9f62773998f89f9c872e2bed5)
daemon: Add option for output file mode
The daemon utility has always created its output file with a fixed mode
of 0600. This causes issues for log collection setups where the collector
does not run as root but instead relies on group access to the watched
daemon’s log file.
Introduce a new option that allows specifying the output file mode using
install(1)-style semantics. This enables non-root log collectors to access
the file as intended and improves compatibility with log rotation tools.
Reviewed by: kevans
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D54930
(cherry picked from commit a3b90a1f008365d9f62773998f89f9c872e2bed5)
daemon: Add option for output file mode
The daemon utility has always created its output file with a fixed mode
of 0600. This causes issues for log collection setups where the collector
does not run as root but instead relies on group access to the watched
daemon’s log file.
Introduce a new option that allows specifying the output file mode using
install(1)-style semantics. This enables non-root log collectors to access
the file as intended and improves compatibility with log rotation tools.
Reviewed by: kevans
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D54930
(cherry picked from commit a3b90a1f008365d9f62773998f89f9c872e2bed5)
diff: Improve directory loop detection
When we're done processing a directory, remove its entry from the tree
of visited inodes, ensuring that we only report a loop when we encounter
a descendant-to-ancestor link, not when we encounter a cousin-to-cousin
or sibling-to-sibling link.
MFC after: 1 week
Reported by: Bakul Shah <bakul at iitbombay.org>
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55248
(cherry picked from commit 71569594d860a59d8362770a56d806e1d31fb946)
install: Expect EINTR while copying
Both copy_file_range() and read() / write() in our fallback loop can be
interrupted before copying anything at all, in which case it returns -1
and sets errno to EINTR. If that happens, we should retry, not fail.
While here, drop the size argument from copy() (we always want to copy
the entire file anyway) and add test cases which exercise the metalog
and digest functionality.
PR: 293028
MFC after: 1 week
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55168
(cherry picked from commit 0fb940fd63dd9b6d6b848421c53b1e9ac8387265)
cp: Expect EINTR while copying
Both copy_file_range() and copy_fallback() can be interrupted before
they have read anything at all, in which case they return -1 and set
errno to EINTR. If that happens, we should retry, not fail.
PR: 293028
MFC after: 1 week
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55167
(cherry picked from commit 7aa30669d6e04444b8ad1e4863a6e674fcac4afc)
install: Expect EINTR while copying
Both copy_file_range() and read() / write() in our fallback loop can be
interrupted before copying anything at all, in which case it returns -1
and sets errno to EINTR. If that happens, we should retry, not fail.
While here, drop the size argument from copy() (we always want to copy
the entire file anyway) and add test cases which exercise the metalog
and digest functionality.
PR: 293028
MFC after: 1 week
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55168
(cherry picked from commit 0fb940fd63dd9b6d6b848421c53b1e9ac8387265)
diff: Improve directory loop detection
When we're done processing a directory, remove its entry from the tree
of visited inodes, ensuring that we only report a loop when we encounter
a descendant-to-ancestor link, not when we encounter a cousin-to-cousin
or sibling-to-sibling link.
MFC after: 1 week
Reported by: Bakul Shah <bakul at iitbombay.org>
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55248
(cherry picked from commit 71569594d860a59d8362770a56d806e1d31fb946)
pwd: Error out if writing to stdout failed
POSIX requires us to print a diagnostic and return a non-zero exit
code if writing to stdout failed.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55227
(cherry picked from commit 5b398611607b0dab2f2550ef73f62d41dab6fac5)
cp: Expect EINTR while copying
Both copy_file_range() and copy_fallback() can be interrupted before
they have read anything at all, in which case they return -1 and set
errno to EINTR. If that happens, we should retry, not fail.
PR: 293028
MFC after: 1 week
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55167
(cherry picked from commit 7aa30669d6e04444b8ad1e4863a6e674fcac4afc)
m4: Change defn processing order
Currently, defn pushes its arguments on the stack in order, which means
they are then processed in reverse order. POSIX does not specify what
order they are processed in, which arguably suggests that they should be
processed in the order they are listed. Push them in reverse order so
they will be processed in their original order. This matches GNU m4.
PR: 292937
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: obiwac, imp
Differential Revision: https://reviews.freebsd.org/D55116
(cherry picked from commit 25a8168f86a1222388475ce858da405e4d06c1c3)
pwd: Clean up and adopt POSIX semantics
According to POSIX, the default should be -L. Based on code history,
whoever first wrote BSD pwd(1) could not figure out how to implement
-L and therefore made -P the default (and only) option. Support for -L
was later added, but the default was never changed.
Clean up the code, make -L the default, and rewrite getcwd_logical() to
reject paths that contain dot or dot-dot, as required by POSIX.
MFC after: 1 week
Reviewed by: olce
Differential Revision: https://reviews.freebsd.org/D55146
(cherry picked from commit 2df923c5d2d02350abc29f61b603c5b9615b225c)
cp: Expect EINTR while copying
Both copy_file_range() and copy_fallback() can be interrupted before
they have read anything at all, in which case they return -1 and set
errno to EINTR. If that happens, we should retry, not fail.
PR: 293028
MFC after: 1 week
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55167
(cherry picked from commit 7aa30669d6e04444b8ad1e4863a6e674fcac4afc)
pwd: Error out if writing to stdout failed
POSIX requires us to print a diagnostic and return a non-zero exit
code if writing to stdout failed.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55227
(cherry picked from commit 5b398611607b0dab2f2550ef73f62d41dab6fac5)
m4: Change defn processing order
Currently, defn pushes its arguments on the stack in order, which means
they are then processed in reverse order. POSIX does not specify what
order they are processed in, which arguably suggests that they should be
processed in the order they are listed. Push them in reverse order so
they will be processed in their original order. This matches GNU m4.
PR: 292937
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: obiwac, imp
Differential Revision: https://reviews.freebsd.org/D55116
(cherry picked from commit 25a8168f86a1222388475ce858da405e4d06c1c3)
diff: Improve directory loop detection
When we're done processing a directory, remove its entry from the tree
of visited inodes, ensuring that we only report a loop when we encounter
a descendant-to-ancestor link, not when we encounter a cousin-to-cousin
or sibling-to-sibling link.
MFC after: 1 week
Reported by: Bakul Shah <bakul at iitbombay.org>
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55248
(cherry picked from commit 71569594d860a59d8362770a56d806e1d31fb946)
install: Expect EINTR while copying
Both copy_file_range() and read() / write() in our fallback loop can be
interrupted before copying anything at all, in which case it returns -1
and sets errno to EINTR. If that happens, we should retry, not fail.
While here, drop the size argument from copy() (we always want to copy
the entire file anyway) and add test cases which exercise the metalog
and digest functionality.
PR: 293028
MFC after: 1 week
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55168
(cherry picked from commit 0fb940fd63dd9b6d6b848421c53b1e9ac8387265)
pwd: Clean up and adopt POSIX semantics
According to POSIX, the default should be -L. Based on code history,
whoever first wrote BSD pwd(1) could not figure out how to implement
-L and therefore made -P the default (and only) option. Support for -L
was later added, but the default was never changed.
Clean up the code, make -L the default, and rewrite getcwd_logical() to
reject paths that contain dot or dot-dot, as required by POSIX.
MFC after: 1 week
Reviewed by: olce
Differential Revision: https://reviews.freebsd.org/D55146
(cherry picked from commit 2df923c5d2d02350abc29f61b603c5b9615b225c)
Add files missed in 56a7ce8416d181a2060d7a42
Skip usr.bin/diff3 tests as these contain text that gets misinterpreted
as merge conflict markers and blocks push with the relevant pre-receive
hook.
PR: 293186
asmc: Add MacPro3,1 temperature sensor support
Test and verified with Sonicblue7
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54952
BSD.usr.dist: remove obsolete usr/share/examples/drivers entry
In base 8f0a6a9aadb1f, usr/share/examples/drivers was cleaned up,
because it contained unmaintained scripts. The directory itself is
cleaned up by ObsoleteFiles.inc, but there was still an entry in
BSD.usr.dist that re-created the directory. Remove it.
Fixes: 8f0a6a9aadb1
MFC after: 3 days
(cherry picked from commit ac2f284258e4c6d5867aa6a411bd44df349fe416)
(cherry picked from commit c44a4859c3c00aa87d5bead34d8646e13c86ea85)
netinet6: Return EAFNOSUPPORT for non-IPv6 addresses in mcast sockopts.
This is a non-functional change; it just returns the correct errno value
where IPv6 multicast socket options were passed non-AF_INET6 arguments,
in preparation for handling PR 193246 with a side-call into netinet as
xnu currently does.
Reviewed by: glebius
Approved by: glebius
PR: 193246 (with refinements)
Differential revision: https://reviews.freebsd.org/D55233
tr: fix class handling in unicode world
toupper/tolower logic was only handled for CCLASS_TOUPPER and
CCLASS_TOLOWER, add support for CCLASS ([:alpha:])
PR: 219900
MFC After: 1 week