Page MenuHomeFreeBSD

install: Assorted nitpickery.
ClosedPublic

Authored by des on Apr 16 2024, 4:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 23, 7:32 AM
Unknown Object (File)
Apr 26 2024, 5:14 AM
Unknown Object (File)
Apr 19 2024, 4:46 PM
Unknown Object (File)
Apr 17 2024, 1:00 PM
Subscribers

Details

Reviewers
markj
Group Reviewers
Klara
Commits
rG000a533e6d1d: install: Assorted nitpickery.
Summary
  • 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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Apr 16 2024, 4:34 PM
markj added a subscriber: markj.
markj added inline comments.
usr.bin/xinstall/xinstall.c
1209

You can use errc() here too.

1242

Also here.

This revision is now accepted and ready to land.Apr 16 2024, 7:16 PM
des marked 2 inline comments as done.Apr 16 2024, 10:17 PM
des added inline comments.
usr.bin/xinstall/xinstall.c
1209

I know, there are lots more, I intentionally limited myself to cases where we were making errno up.

This revision was automatically updated to reflect the committed changes.
des marked an inline comment as done.