Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jan 2004 15:54:32 +0100
From:      Wiktor Niesiobedzki <freebsd-lists@w.evip.pl>
To:        Kimura Fuyuki <fuyuki@nigredo.org>
Cc:        Kirk McKusick <mckusick@beastie.mckusick.com>
Subject:   Re: mksnap slashes acls option?
Message-ID:  <20040127145432.GC95463@mail.evip.pl>
In-Reply-To: <86zncjqv5c.wl%fuyuki@nigredo.org>
References:  <400C6FC5.2040708@cs.unisa.edu.au> <86zncjqv5c.wl%fuyuki@nigredo.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--s2ZSL+KKDSLx8OML
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Jan 20, 2004 at 10:13:51AM +0900, Kimura Fuyuki wrote:
> Something dangerous seems to happen...
> 
> # mdmfs -s 1m -o acls md1 /mnt
> # mount
> <snip>
> /dev/md1 on /mnt (ufs, local, soft-updates, acls)
> # mksnap_ffs /mnt /mnt/.snap/snap
> # mount
> <snip>
> /dev/md1 on /mnt (ufs, local, soft-updates)
>                                           !!!!
> Ooh, where is the acls option??
> 
Some small patch to mksnap_ffs to correct this bug.

Can someone review this and commit?


Cheers,

Wiktor Niesiobedzki

--s2ZSL+KKDSLx8OML
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="mksnap.diff"

--- 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);

--s2ZSL+KKDSLx8OML--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040127145432.GC95463>