Page MenuHomeFreeBSD

savecore: decrease filename buffer sizes
ClosedPublic

Authored by mhorne on Apr 7 2022, 3:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 7:59 AM
Unknown Object (File)
Fri, Apr 12, 7:55 AM
Unknown Object (File)
Fri, Apr 12, 7:49 AM
Unknown Object (File)
Thu, Apr 11, 5:29 PM
Unknown Object (File)
Wed, Apr 3, 10:14 AM
Unknown Object (File)
Mar 7 2024, 11:44 AM
Unknown Object (File)
Feb 11 2024, 5:56 AM
Unknown Object (File)
Feb 11 2024, 5:56 AM
Subscribers

Details

Summary

All files are now created relative to savedirfd, e.g. with openat(2).
Therefore, we do not need character buffers to be PATH_MAX bytes long,
just long enough to hold the complete filename. 32 bytes is long enough
in all cases. These can be allocated on the stack.

While here, fix an error message that attempts to use an uninitialized
infoname.

Diff Detail

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

Event Timeline

mhorne requested review of this revision.Apr 7 2022, 3:04 PM
mhorne added inline comments.
sbin/savecore/savecore.c
700–702

Choosing to list the static var first.

markj added inline comments.
sbin/savecore/savecore.c
700–702

I prefer that too.

703

The keyname declaration fits on the previous line now.

This revision is now accepted and ready to land.Apr 7 2022, 3:32 PM
This revision was automatically updated to reflect the committed changes.