diff options
author | phk <phk@FreeBSD.org> | 2004-12-08 11:54:50 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-12-08 11:54:50 +0000 |
commit | 96f1216abd0ae24d31b1c660fdbeeb17f1cca646 (patch) | |
tree | 3d275fff31bbf8310abccc32310fe1f8c235f923 | |
parent | 125513db7561f48c4ce5c140cea8049d50454ef2 (diff) | |
download | FreeBSD-src-96f1216abd0ae24d31b1c660fdbeeb17f1cca646.zip FreeBSD-src-96f1216abd0ae24d31b1c660fdbeeb17f1cca646.tar.gz |
Make sure we don't pass garbage to the kernel.
The filesystem is named "ufs" not "ffs".
-rw-r--r-- | sbin/mksnap_ffs/mksnap_ffs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/mksnap_ffs/mksnap_ffs.c b/sbin/mksnap_ffs/mksnap_ffs.c index a061286..a7ff957 100644 --- a/sbin/mksnap_ffs/mksnap_ffs.c +++ b/sbin/mksnap_ffs/mksnap_ffs.c @@ -66,6 +66,7 @@ main(int argc, char **argv) usage(); dir = argv[1]; + memset(&args, 0, sizeof args); args.fspec = argv[2]; /* @@ -103,7 +104,7 @@ main(int argc, char **argv) */ if ((grp = getgrnam("operator")) == NULL) 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) err(1, "Cannot create %s", args.fspec); if ((fd = open(args.fspec, O_RDONLY)) < 0) |