opnsense-src/sbin/mount
Jason A. Harmening a314c60625 mount(8): Avoid truncation when fstab-formatting unionfs mount info
When displaying unionfs mounts in fstab format (`mount -p`), mount(8)
currently uses strlcpy to remove the disposition prefix from the mount
name returned by getmntinfo(3).  But strlcpy, like strcpy before it,
does not guarantee correct behavior if the source and destination
buffers overlap.

Just offset the buffer and avoid the destructive copy in the first
place.

PR:		283420
Reviewed by:	imp (previous version), olce
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D48177
2024-12-29 18:39:49 -06:00
..
extern.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
getmntopts.c sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
mntopts.3 manuals: Remove trailing spaces 2024-11-04 11:26:14 -04:00
mntopts.h sbin: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
mount.8 sbin/{ffsinfo,mount,newfs}: reference ffs(4) in man pages 2024-11-25 22:57:20 +01:00
mount.c mount(8): Avoid truncation when fstab-formatting unionfs mount info 2024-12-29 18:39:49 -06:00
mount_fs.c Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
pathnames.h sbin: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
vfslist.c sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00