mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-25 11:37:56 +00:00
Don't default to '/var/tmp/ffsinfo' for the output of ffsinfo(8), since
/var/tmp is a world-writable directory. MFC after: 3 days Reported by: Jon Passki <cykyc@yahoo.com>
This commit is contained in:
parent
934761ae4b
commit
c4b2cc12ae
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144361
@ -106,18 +106,19 @@ inode information
|
||||
indirect block dump
|
||||
.El
|
||||
.It Fl o Ar outfile
|
||||
This allows to change the output filename where the dump is written to.
|
||||
The current default is
|
||||
.Pa /var/tmp/ffsinfo .
|
||||
This allows to set the output filename where the dump is written to, and
|
||||
must be specified.
|
||||
If
|
||||
.Fl
|
||||
is provided, output will be sent to stdout.
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
.Dl ffsinfo -l 1023 /dev/vinum/testvol
|
||||
.Dl ffsinfo -o /var/tmp/ffsinfo -l 1023 /dev/vinum/testvol
|
||||
.Pp
|
||||
will dump
|
||||
.Pa /dev/vinum/testvol
|
||||
to
|
||||
.Pa /var/tmp/ffsinfo
|
||||
with all available information.
|
||||
.Sh SEE ALSO
|
||||
.Xr disklabel 8 ,
|
||||
|
@ -141,10 +141,7 @@ main(int argc, char **argv)
|
||||
cfg_lv=0xff;
|
||||
cfg_in=-2;
|
||||
cfg_cg=-2;
|
||||
out_file=strdup("/var/tmp/ffsinfo");
|
||||
if(out_file == NULL) {
|
||||
errx(1, "strdup failed");
|
||||
}
|
||||
out_file=NULL;
|
||||
|
||||
while ((ch=getopt(argc, argv, "g:i:l:o:")) != -1) {
|
||||
switch(ch) {
|
||||
@ -192,6 +189,8 @@ main(int argc, char **argv)
|
||||
usage();
|
||||
}
|
||||
device=*argv;
|
||||
if (out_file == NULL)
|
||||
errx(1, "out_file not specified");
|
||||
|
||||
/*
|
||||
* Now we try to guess the (raw)device name.
|
||||
|
Loading…
Reference in New Issue
Block a user