]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
trim(8): add another safety net
authoreugen <eugen@FreeBSD.org>
Thu, 14 Mar 2019 12:25:16 +0000 (12:25 +0000)
committereugen <eugen@FreeBSD.org>
Thu, 14 Mar 2019 12:25:16 +0000 (12:25 +0000)
commitce3b3184323f9fe01d2c05920233a8a5184fc7ff
treef46b0d60ae6872b788cbba3e360f7cd0faec98d2
parent2aa7ec640fc5a900a9d55358dfeba825c52b8e10
trim(8): add another safety net

It is quite easy make a mistake and run something like this:

trim -f /dev/da0 -r rfile

This would trim the whole device then emit an error on non-existing file -r.

Add another check to prevent this while allowing this form still
for real object names beginning from dash:

trim -f -- /dev/da0 -r rfile

MFC after: 1 week
usr.sbin/trim/trim.c