From owner-freebsd-current@FreeBSD.ORG Tue Jan 27 06:55:00 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 823C316A4CE for ; Tue, 27 Jan 2004 06:55:00 -0800 (PST) Received: from mail.evip.pl (mail.evip.com.pl [212.244.157.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17C0743D86 for ; Tue, 27 Jan 2004 06:54:51 -0800 (PST) (envelope-from w@evip.pl) Received: from drwebc by mail.evip.pl with drweb-scanned (Exim 4.22) id 1AlUbo-0008RN-AG; Tue, 27 Jan 2004 15:54:32 +0100 Received: from w by mail.evip.pl with local (Exim 4.22) id 1AlUbo-0008RH-7J; Tue, 27 Jan 2004 15:54:32 +0100 Date: Tue, 27 Jan 2004 15:54:32 +0100 From: Wiktor Niesiobedzki To: Kimura Fuyuki Message-ID: <20040127145432.GC95463@mail.evip.pl> References: <400C6FC5.2040708@cs.unisa.edu.au> <86zncjqv5c.wl%fuyuki@nigredo.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="s2ZSL+KKDSLx8OML" Content-Disposition: inline In-Reply-To: <86zncjqv5c.wl%fuyuki@nigredo.org> User-Agent: Mutt/1.4i Sender: Wiktor Niesiobedzki cc: freebsd-current@freebsd.org cc: Kirk McKusick Subject: Re: mksnap slashes acls option? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2004 14:55:00 -0000 --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 > > /dev/md1 on /mnt (ufs, local, soft-updates, acls) > # mksnap_ffs /mnt /mnt/.snap/snap > # mount > > /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--