aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Gurney <jmg@FreeBSD.org>2004-08-09 05:46:46 +0000
committerJohn-Mark Gurney <jmg@FreeBSD.org>2004-08-09 05:46:46 +0000
commit6141e04a7e4015e57a61ab5724aa53bb9a9820b8 (patch)
tree7cac3147b845b53ec63cfd99bc8fbaa96f6a32db
parent37a0f3914b3bc747360ae8c47a789612b9ddba0c (diff)
downloadsrc-6141e04a7e4015e57a61ab5724aa53bb9a9820b8.tar.gz
src-6141e04a7e4015e57a61ab5724aa53bb9a9820b8.zip
add option to automaticly mark core dumps with the nodump flag
PR: 57065 Submitted by: Walter C. Pelissero
Notes
Notes: svn path=/head/; revision=133354
-rw-r--r--sys/kern/kern_sig.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index fc2bdcdebfcc..e6e8f67da88e 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -122,6 +122,10 @@ static int do_coredump = 1;
SYSCTL_INT(_kern, OID_AUTO, coredump, CTLFLAG_RW,
&do_coredump, 0, "Enable/Disable coredumps");
+static int set_core_nodump_flag = 0;
+SYSCTL_INT(_kern, OID_AUTO, nodump_coredump, CTLFLAG_RW, &set_core_nodump_flag,
+ 0, "Enable setting the NODUMP flag on coredump files");
+
/*
* Signal properties and actions.
* The array below categorizes the signals and their default actions
@@ -2617,6 +2621,8 @@ restart:
VATTR_NULL(&vattr);
vattr.va_size = 0;
+ if (set_core_nodump_flag)
+ vattr.va_flags = UF_NODUMP;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
VOP_LEASE(vp, td, cred, LEASE_WRITE);
VOP_SETATTR(vp, &vattr, cred, td);