--- sbin/mksnap_ffs/mksnap_ffs.c 2003/11/04 07:04:01 1.5 +++ sbin/mksnap_ffs/mksnap_ffs.c 2004/01/27 14:23:46 @@ -59,6 +59,7 @@ struct ufs_args args; struct group *grp; struct stat stbuf; + struct statfs stfsbuf; int fd; if (argc != 3) @@ -94,13 +95,15 @@ if ((stbuf.st_mode & S_ISTXT) && stbuf.st_uid != getuid()) errx(1, "Lack write permission in %s: Sticky bit set", path); + if(statfs(path, &stfsbuf) < 0) + err(1, "%s", path); /* * Having verified access to the directory in which the * snapshot is to be built, proceed with creating it. */ if ((grp = getgrnam("operator")) == NULL) errx(1, "Cannot retrieve operator gid"); - if (mount("ffs", dir, MNT_UPDATE | MNT_SNAPSHOT, &args) < 0) + if (mount("ffs", 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) err(1, "Cannot open %s", args.fspec);