#
4b04f5d7 |
| 17-Jan-2025 |
Ed Maste <emaste@FreeBSD.org> |
install: Fix METALOG ouptut for numeric -o and -g args
install's -o and -g flags both accept a name or a numeric argument. In -U -M (non-root METALOG) mode it always emitted uname= and gname= in the
install: Fix METALOG ouptut for numeric -o and -g args
install's -o and -g flags both accept a name or a numeric argument. In -U -M (non-root METALOG) mode it always emitted uname= and gname= in the METALOG, but these are not appropriate for numeric IDs.
If the -o and/or -u arguments parse as an ID, emit uid= and/or gid= respectively.
Note that if an argument is valid as both a name and numeric ID we will prefer the name in normal (non -U -M) mode and the ID in -U -M mode. We don't want to require a passwd db in non-root mode, and entirely-numeric user or group names are a terrible idea so just accept this discrepancy.
PR: 284119 Reviewed by: jlduran Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48504
show more ...
|
Revision tags: release/14.2.0, release/13.4.0 |
|
#
e8d027be |
| 14-Aug-2024 |
Ahmad Khalifa <ahmadkhalifa570@gmail.com> |
install: print directory name instead of file name if mkstemp fails
Printing the file name doesn't make sense since mkstemp failing means that the file wasn't created.
Also add a test case for this
install: print directory name instead of file name if mkstemp fails
Printing the file name doesn't make sense since mkstemp failing means that the file wasn't created.
Also add a test case for this.
Co-authored-by: Jose Luis Duran <jlduran@gmail.com> Reviewed by: imp,jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1383
show more ...
|
Revision tags: release/14.1.0 |
|
#
2f44f865 |
| 19-Apr-2024 |
Mark Johnston <markj@FreeBSD.org> |
install: Fix a compiler warning when bootstrapping
Fixes: 4336161cc9c6 ("install: Don't skip syncing in the common case.") Reviewed by: imp, des Differential Revision: https://reviews.freebsd.org/D
install: Fix a compiler warning when bootstrapping
Fixes: 4336161cc9c6 ("install: Don't skip syncing in the common case.") Reviewed by: imp, des Differential Revision: https://reviews.freebsd.org/D44866
show more ...
|
#
000a533e |
| 17-Apr-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
install: Assorted nitpickery.
* Use `errc()` instead of manually setting `errno` before calling `err()`. * Change one warning into a fatal error. * Drop some unnecessary casts. * `strlcat()` bounds
install: Assorted nitpickery.
* Use `errc()` instead of manually setting `errno` before calling `err()`. * Change one warning into a fatal error. * Drop some unnecessary casts. * `strlcat()` bounds checks were off-by-one. This does not matter in practice because the subsequent code renders an overrun harmless. * We were passing `SSIZE_MAX` to `copy_file_range()` instead of the requested size. This only matters if we're asked to install a file which is still being written to while we are copying it.
MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44810
show more ...
|
#
a0439a1b |
| 17-Apr-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
install: Remove the mmap(2) option.
We already removed it from cp(1) over a year ago but never followed up here. Do so now, for the same reasons: significant complexity for little to no benefit.
M
install: Remove the mmap(2) option.
We already removed it from cp(1) over a year ago but never followed up here. Do so now, for the same reasons: significant complexity for little to no benefit.
MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44809
show more ...
|
#
4336161c |
| 12-Apr-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
install: Don't skip syncing in the common case.
In `copy()`, if no digest was requested (which is the common case), we use `copy_file_range()` to avoid needlessly copying the contents of the file in
install: Don't skip syncing in the common case.
In `copy()`, if no digest was requested (which is the common case), we use `copy_file_range()` to avoid needlessly copying the contents of the file into user space and back. When `copy_file_range()` returns successfully (which, again, is the common case), we simply return, and therefore never get to the point where we call `fsync()` if the `-S` option was specified. Fix this.
MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44756
show more ...
|
#
17dc7017 |
| 12-Apr-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
install: Simplify path construction.
There's no need to copy the path twice to split it into base and dir. We simply call `basename()` first, then handle the two trivial cases in which it isn't safe
install: Simplify path construction.
There's no need to copy the path twice to split it into base and dir. We simply call `basename()` first, then handle the two trivial cases in which it isn't safe to call `dirname()`.
While here, add an early check that the destination is not an empty string. This would always fail eventually, so it may as well fail right away. Also add a test case for this shortcut.
MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44743
show more ...
|
#
e5035d08 |
| 12-Apr-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
install: Always use a temporary file.
Previously, we would only use a temporary file if explicitly asked to with the `-S` option, and even then, only if the target file already existed. This meant
install: Always use a temporary file.
Previously, we would only use a temporary file if explicitly asked to with the `-S` option, and even then, only if the target file already existed. This meant that an outside observer looking for the target file might see a partial file, and might see the file disappear and then reappear.
With this patch, we always use a temporary file, ensuring atomicity. The downside is slightly increased disk usage. The upside is never having to worry about, for instance, cron jobs randomly failing if they happen to run simultaneously with `make installworld`.
The `-S` option is retained, partly for compatibility, and partly to control the use of `fsync(2)`, which has a non-negligible cost (approximately 10% increase in wall time for `make installworld`).
MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: 0mp, brooks, imp, markj Differential Revision: https://reviews.freebsd.org/D44742
show more ...
|
#
2cab4be4 |
| 27-Mar-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
install: Prefer strsnvis() to strsvis().
MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44514
|
Revision tags: release/13.3.0 |
|
#
1d83ae9d |
| 07-Jan-2024 |
LO WEN-CHIEN <s111062113@m111.nthu.edu.tw> |
install(1): Fix typo in usr.bin/xinstall/xinstall.c
Event: Advanced UNIX Programming Course (Fall’23) at NTHU Pull Request: https://github.com/freebsd/freebsd-src/pull/1012
|
#
0b8224d1 |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals.
Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require).
Sponsored by: Netflix
show more ...
|
#
bdcbfde3 |
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
usr.bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a pe
usr.bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
767c97c5 |
| 19-Oct-2023 |
Kyle Evans <kevans@FreeBSD.org> |
install: handle -m +X more accurately
As described by chmod(1), +X in the mode may be used to optionally set the +x bit if the file is a directory if any of the execute/search bits are set in the or
install: handle -m +X more accurately
As described by chmod(1), +X in the mode may be used to optionally set the +x bit if the file is a directory if any of the execute/search bits are set in the original mode. The latter is not applicable because we assume -m is a fresh mask, but a functional +X could be useful in the former case if we're passing along a common INSTALL_MODE that's designed to install either 0644 or 0755 depending simply on whether it's a directory or not.
Reviewed by: des Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D42273
show more ...
|
#
1d386b48 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
e64780fb |
| 09-Jul-2023 |
Martin Matuska <mm@FreeBSD.org> |
xinstall: do not use copy_file_range(2) when BOOTSTRAPPING
Reported by: arichardson
|
#
5a50d52f |
| 08-Jul-2023 |
Martin Matuska <mm@FreeBSD.org> |
xinstall: use copy_file_range(2) with fallback to previous behavior
This allows to use special filesystem features like server-side copying on NFS 4.2 or block cloning on OpenZFS 2.2.
Note: copy_fi
xinstall: use copy_file_range(2) with fallback to previous behavior
This allows to use special filesystem features like server-side copying on NFS 4.2 or block cloning on OpenZFS 2.2.
Note: copy_file_range(2) is not used when a digest calculation is requested as this would require to read the input file twice.
Reviewed by: asomers, imp, rmacklem Differential revision: https://reviews.freebsd.org/D40898
show more ...
|
Revision tags: release/13.2.0, release/12.4.0 |
|
#
54d8d0fe |
| 03-Aug-2022 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
xinstall: use dynamic bufsize as in cat(1) / cp(1).
Sponsored by: Klara, Inc.
|
#
c7a8e8d3 |
| 03-Aug-2022 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
xinstall: make md5 and ripemd160 conditional
Sponsored by: Klara, Inc.
|
#
36d67475 |
| 03-Aug-2022 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
xinstall: fix dounpriv logic, add tests
Sponsored by: Klara, Inc. MFC after: 1 week
|
Revision tags: release/13.1.0, release/12.3.0 |
|
#
4d0dc60f |
| 02-Jun-2021 |
Mitchell Horne <mhorne@FreeBSD.org> |
xinstall: fix invocation of llvm-strip
When executing strip(1), '--' is passed as an argument to explicitly terminate the getopt(3) loop. The option parsing in llvm-strip doesn't support this howeve
xinstall: fix invocation of llvm-strip
When executing strip(1), '--' is passed as an argument to explicitly terminate the getopt(3) loop. The option parsing in llvm-strip doesn't support this however, so setting XSTRIPBIN=llvm-strip results in an unsupported argument error. llvm-strip(1) is otherwise commandline-compatible with FreeBSD's strip(1), so just use the documented argument format that is common to both.
Special care needs to be taken for filenames beginning with a '-'.
Reviewed by: arichardson, eugen (earlier version, both) Discussed with: jilles Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D30614
show more ...
|
Revision tags: release/13.0.0, release/12.2.0 |
|
#
6e4162c6 |
| 14-Oct-2020 |
Alex Richardson <arichardson@FreeBSD.org> |
install(1): Avoid unncessary fstatfs() calls and use mmap() based on size
According to git blame the trymmap() function was added in 1996 to skip mmap() calls for NFS file systems. However, nowadays
install(1): Avoid unncessary fstatfs() calls and use mmap() based on size
According to git blame the trymmap() function was added in 1996 to skip mmap() calls for NFS file systems. However, nowadays mmap() should be perfectly safe even on NFS. Importantly, onl ufs and cd9660 file systems were whitelisted so we don't use mmap() on ZFS. It also prevents the use of mmap() when bootstrapping from macOS/Linux since on those systems the trymmap() function was always returning zero due to the missing MFSNAMELEN define.
This change keeps the trymmap() function but changes it to check whether using mmap() can reduce the number of system calls that are required. Using mmap() only reduces the number of system calls if we need multiple read() syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is more expensive than read() so this sets the threshold at 4 fewer syscalls. Additionally, for larger file size mmap() can significantly increase the number of page faults, so avoid it in that case.
It's unclear whether using mmap() is ever faster than a read with an appropriate buffer size, but this change at least removes two unnecessary system calls for every file that is installed.
Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D26041
show more ...
|
#
e2c0e292 |
| 16-Jul-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
#
0fd54da0 |
| 15-Jul-2020 |
Alex Richardson <arichardson@FreeBSD.org> |
Allow install(1)'s create_tempfile() to work on Linux hosts
GLibc expects six 'X' characters in the mkstemp template argument and will return EINVAL otherwise.
Reviewed By: emaste, imp, mjg Differe
Allow install(1)'s create_tempfile() to work on Linux hosts
GLibc expects six 'X' characters in the mkstemp template argument and will return EINVAL otherwise.
Reviewed By: emaste, imp, mjg Differential Revision: https://reviews.freebsd.org/D25662
show more ...
|
#
57f09d08 |
| 12-Jul-2020 |
Eugene Grosbein <eugen@FreeBSD.org> |
install(1): another correction after r363064
Make sure we call fsync(2) on strip result in case of "safecopy" and "strip -o tempcopy -- src" before renaming tempcopy to destination.
MFC after: 3 we
install(1): another correction after r363064
Make sure we call fsync(2) on strip result in case of "safecopy" and "strip -o tempcopy -- src" before renaming tempcopy to destination.
MFC after: 3 weeks X-MFC-With: r363064
show more ...
|
#
cd88eaa5 |
| 10-Jul-2020 |
Eugene Grosbein <eugen@FreeBSD.org> |
install(1): addition to r363067
Also, make it not break if STRIPBIN points to strip version without -o support and destination does not exist before installing.
Reported by: lwhsu MFC after: 1
install(1): addition to r363067
Also, make it not break if STRIPBIN points to strip version without -o support and destination does not exist before installing.
Reported by: lwhsu MFC after: 1 month X-MFC-With: 363064
show more ...
|