Make sure we don't pass garbage to the kernel.

The filesystem is named "ufs" not "ffs".
This commit is contained in:
phk 2004-12-08 11:54:50 +00:00
parent 125513db75
commit 96f1216abd

View File

@ -66,6 +66,7 @@ main(int argc, char **argv)
usage(); usage();
dir = argv[1]; dir = argv[1];
memset(&args, 0, sizeof args);
args.fspec = argv[2]; args.fspec = argv[2];
/* /*
@ -103,7 +104,7 @@ main(int argc, char **argv)
*/ */
if ((grp = getgrnam("operator")) == NULL) if ((grp = getgrnam("operator")) == NULL)
errx(1, "Cannot retrieve operator gid"); errx(1, "Cannot retrieve operator gid");
if (mount("ffs", dir, MNT_UPDATE | MNT_SNAPSHOT | stfsbuf.f_flags, if (mount("ufs", dir, MNT_UPDATE | MNT_SNAPSHOT | stfsbuf.f_flags,
&args) < 0) &args) < 0)
err(1, "Cannot create %s", args.fspec); err(1, "Cannot create %s", args.fspec);
if ((fd = open(args.fspec, O_RDONLY)) < 0) if ((fd = open(args.fspec, O_RDONLY)) < 0)