kern/57065: core dumps with NODUMP flag
Walter C. Pelissero
walter at pelissero.de
Sun Sep 21 12:20:17 PDT 2003
>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 at 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:
More information about the freebsd-bugs
mailing list