From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 21 12:20:17 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F58816A4B3 for ; Sun, 21 Sep 2003 12:20:17 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0202E43FCB for ; Sun, 21 Sep 2003 12:20:15 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h8LJKFFY072975 for ; Sun, 21 Sep 2003 12:20:15 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h8LJKFRA072974; Sun, 21 Sep 2003 12:20:15 -0700 (PDT) (envelope-from gnats) Resent-Date: Sun, 21 Sep 2003 12:20:15 -0700 (PDT) Resent-Message-Id: <200309211920.h8LJKFRA072974@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, 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 ; 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 ; 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 ; 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 ; 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" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/57065: core dumps with NODUMP flag X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: walter@pelissero.de List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2003 19:20:17 -0000 >Number: 57065 >Category: kern >Synopsis: core dumps with NODUMP flag >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Sep 21 12:20:15 PDT 2003 >Closed-Date: >Last-Modified: >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: >Unformatted: