Date: Sun, 10 Dec 2000 17:01:21 +0100 From: Poul-Henning Kamp <phk@critter.freebsd.dk> Cc: arch@FreeBSD.ORG Subject: Re: inheriting the "nodump" flag ? Message-ID: <98900.976464081@critter> In-Reply-To: Your message of "Sun, 10 Dec 2000 12:25:04 %2B0100." <97286.976447504@critter>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?98900.976464081>
