Page MenuHomeFreeBSD

install: Assorted nitpickery.
ClosedPublic

Authored by des on Apr 16 2024, 4:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 7, 4:13 PM
Unknown Object (File)
Mon, Nov 25, 11:16 AM
Unknown Object (File)
Mon, Nov 25, 11:16 AM
Unknown Object (File)
Nov 23 2024, 5:42 AM
Unknown Object (File)
Nov 22 2024, 12:13 PM
Unknown Object (File)
Nov 21 2024, 2:16 PM
Unknown Object (File)
Nov 20 2024, 7:37 AM
Unknown Object (File)
Nov 19 2024, 3:13 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.