summaryrefslogtreecommitdiffstats
path: root/sbin/ffsinfo/ffsinfo.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-03-31 04:05:17 +0000
committerrwatson <rwatson@FreeBSD.org>2005-03-31 04:05:17 +0000
commitfe3d70d05486af0dfd857c9c949f1bedde08ed3d (patch)
tree52b542049cd87437b6e5754eb5a311e90c232f44 /sbin/ffsinfo/ffsinfo.c
parent5c2e7e3808b53670949cec21a2950d9a277050ca (diff)
downloadFreeBSD-src-fe3d70d05486af0dfd857c9c949f1bedde08ed3d.zip
FreeBSD-src-fe3d70d05486af0dfd857c9c949f1bedde08ed3d.tar.gz
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>
Diffstat (limited to 'sbin/ffsinfo/ffsinfo.c')
-rw-r--r--sbin/ffsinfo/ffsinfo.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/ffsinfo/ffsinfo.c b/sbin/ffsinfo/ffsinfo.c
index 6ee4c8d..8df4b41 100644
--- a/sbin/ffsinfo/ffsinfo.c
+++ b/sbin/ffsinfo/ffsinfo.c
@@ -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.
OpenPOWER on IntegriCloud