From walter@pelissero.de  Sun Sep 21 12:19:35 2003
Return-Path: <walter@pelissero.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DC5E816A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 21 Sep 2003 12:19:35 -0700 (PDT)
Received: from webmail.tiscali.de (relay1.tiscali.de [62.26.116.129])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7FD1A43FFD
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 21 Sep 2003 12:19:34 -0700 (PDT)
	(envelope-from walter@pelissero.de)
Received: from daemon.home.loc (62.246.54.48) by webmail.tiscali.de (6.7.019)
        id 3F59F638005CB564 for FreeBSD-gnats-submit@freebsd.org; Sun, 21 Sep 2003 21:19:33 +0200
Received: from hyde.home.loc (hyde.home.loc [10.0.0.2])
	by daemon.home.loc (8.12.9/8.12.8) with ESMTP id h8LJIQTx000457
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 21 Sep 2003 21:18:26 +0200 (CEST)
	(envelope-from wcp@hyde.home.loc)
Received: from hyde.home.loc (localhost [127.0.0.1])
	by hyde.home.loc (8.12.9/8.12.8) with ESMTP id h8LJIQ0o000542
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 21 Sep 2003 21:18:26 +0200 (CEST)
	(envelope-from wcp@hyde.home.loc)
Received: (from wcp@localhost)
	by hyde.home.loc (8.12.9/8.12.6/Submit) id h8LJIQ7I000541;
	Sun, 21 Sep 2003 21:18:26 +0200 (CEST)
	(envelope-from wcp)
Message-Id: <200309211918.h8LJIQ7I000541@hyde.home.loc>
Date: Sun, 21 Sep 2003 21:18:26 +0200 (CEST)
From: "Walter C. Pelissero" <walter@pelissero.de>
Reply-To: walter@pelissero.de
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: core dumps with NODUMP flag
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         57065
>Category:       kern
>Synopsis:       core dumps with NODUMP flag
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jmg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 21 12:20:15 PDT 2003
>Closed-Date:    Mon Aug 09 05:47:13 GMT 2004
>Last-Modified:  Mon Aug 09 05:47:13 GMT 2004
>Originator:     Walter C. Pelissero
>Release:        FreeBSD 4.9-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD hyde.home.loc 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #3: Sun Sep 21 21:01:59 CEST 2003 root@hyde.home.loc:/.amd_mnt/daemon/host/usr/warehouse/src/sys/compile/PCG-XG9 i386


	
>Description:
	Saving core dumps in backup tapes is something that is seldom
	desired.  Excluding those core dump files from backups would
	cut on backup time and required tape space.

>How-To-Repeat:

>Fix:
	The following patch gives the choice, via a sysctl flag, to
	automatically create core dumps with the NODUMP flag set, thus
	automatically excluding those files from the next backup.

--- /sys/kern/kern_sig.c.orig	Mon May 19 16:41:42 2003
+++ /sys/kern/kern_sig.c	Sun Sep 21 21:01:44 2003
@@ -119,6 +119,10 @@
 SYSCTL_INT(_kern, OID_AUTO, coredump, CTLFLAG_RW,
 	&do_coredump, 0, "Enable/Disable coredumps");
 
+static int set_nodump_flag = 0;
+SYSCTL_INT(_kern, OID_AUTO, nodump_coredump, CTLFLAG_RW,
+	&set_nodump_flag, 0, "Enable/Disable setting of NODUMP flag on coredump files");
+
 /*
  * Signal properties and actions.
  * The array below categorizes the signals and their default actions
@@ -1656,6 +1660,8 @@
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
 	vattr.va_size = 0;
 	VOP_LEASE(vp, p, cred, LEASE_WRITE);
+	if (set_nodump_flag)
+		vattr.va_flags = UF_NODUMP;
 	VOP_SETATTR(vp, &vattr, cred, p);
 	p->p_acflag |= ACORE;
 	VOP_UNLOCK(vp, 0, p);
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jmg 
Responsible-Changed-By: jmg 
Responsible-Changed-When: Sun Sep 21 13:22:43 PDT 2003 
Responsible-Changed-Why:  
I said I'd take over this feature request 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57065 
State-Changed-From-To: open->closed 
State-Changed-By: jmg 
State-Changed-When: Mon Aug 9 05:47:01 GMT 2004 
State-Changed-Why:  
thanks for the patch, committed... 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57065 
>Unformatted:
