From owner-freebsd-arch Sun Dec 10 8: 1:25 2000 From owner-freebsd-arch@FreeBSD.ORG Sun Dec 10 08:01:23 2000 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from critter.freebsd.dk (flutter.freebsd.dk [212.242.40.147]) by hub.freebsd.org (Postfix) with ESMTP id EE7CB37B400 for ; Sun, 10 Dec 2000 08:01:22 -0800 (PST) Received: from critter (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.1/8.11.1) with ESMTP id eBAG1LL98902 for ; Sun, 10 Dec 2000 17:01:21 +0100 (CET) (envelope-from phk@critter.freebsd.dk) Cc: arch@FreeBSD.ORG Subject: Re: inheriting the "nodump" flag ? In-Reply-To: Your message of "Sun, 10 Dec 2000 12:25:04 +0100." <97286.976447504@critter> Date: Sun, 10 Dec 2000 17:01:21 +0100 Message-ID: <98900.976464081@critter> From: Poul-Henning Kamp Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <97286.976447504@critter>, Poul-Henning Kamp writes: > >I don't know how many of you know or even use the "nodump" file flag. > >It's utility is somewhat limited by the fact that it is not >inherited from the parent directory. > >I like to mark my cvs tree as "nodump", there is no point in backing >it up for me. > >Unfortunately, since the nodump flag is not inherited on creation >I need to run "chflags -R nodump /home/ncvs" first every time I want >to make a backup. > >I would like to propose that directories and files inherit the >nodump flag if it is set on the directory they are created in. > >Comments ? protests ? Attached is the surprisingly simple patch to implement this in ufs. Index: ufs/ufs/ufs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ufs/ufs_vnops.c,v retrieving revision 1.154 diff -u -r1.154 ufs_vnops.c --- ufs/ufs/ufs_vnops.c 2000/11/04 08:10:56 1.154 +++ ufs/ufs/ufs_vnops.c 2000/12/10 15:30:25 @@ -1355,6 +1355,7 @@ #endif #endif /* !SUIDDIR */ ip->i_flag |= IN_ACCESS | IN_CHANGE | IN_UPDATE; + ip->i_flags |= (dp->i_flags & UF_NODUMP); ip->i_mode = dmode; tvp->v_type = VDIR; /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 2; @@ -2071,6 +2072,7 @@ return (error); ip = VTOI(tvp); ip->i_gid = pdir->i_gid; + ip->i_flags |= (pdir->i_flags & UF_NODUMP); #ifdef SUIDDIR { #ifdef QUOTA -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message