Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 91da99e378e0f12c1a50cb7f799eddfe > files > 1

perl-Linux-Prctl-1.400.0-3.mga3.src.rpm

From febf6e713aa6790e215c9ea97fc048623b21cf76 Mon Sep 17 00:00:00 2001
From: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Date: Mon, 4 Jun 2012 15:26:28 +0200
Subject: [PATCH] Yama got accepted into the kernel proper

- Update the availability note about {get,set}_ptracer
- Test whether yama was compiled in before testing {get,set}_ptracer
---
 lib/Linux/Prctl.pm |    6 ++++--
 t/ptracer.t        |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/Linux/Prctl.pm b/lib/Linux/Prctl.pm
index 90245a0..80840c7 100644
--- a/lib/Linux/Prctl.pm
+++ b/lib/Linux/Prctl.pm
@@ -192,14 +192,16 @@ process, assuming other requirements are met (matching uid, wasn't setuid,
 etc). Use pid 0 to disallow all processes. For more details, see
 /etc/sysctl.d/10-ptrace.conf.
 
-This is an ubuntu specific call, appearing as of Ubuntu 10.10
+This function is only available for kernel 3.4 and newer, or Ubuntu 10.10 and
+newer.
 
 =head3 get_ptracer(pid)
 
 Returns the top of the process tree that is allowed to use PTRACE on the
 calling process. See set_ptracer.
 
-This is an ubuntu specific call, appearing as of Ubuntu 10.10
+This function is only available for kernel 3.4 and newer, or Ubuntu 10.10 and
+newer.
 
 =head3 set_seccomp(mode)
 
diff --git a/t/ptracer.t b/t/ptracer.t
index b3fdc46..5df8832 100644
--- a/t/ptracer.t
+++ b/t/ptracer.t
@@ -6,6 +6,7 @@ use Linux::Prctl qw(:constants :functions);
 
 SKIP: {
     skip "set_ptracer not available", 2 unless Linux::Prctl->can('set_ptracer');
+    skip "yama not available", 2 unless -e "/proc/sys/kernel/yama";
     is(set_ptracer(1), 0, "Setting ptracer to 1 (init)");
     my $pid = fork or exit;
     waitpid $pid, 0;
-- 
1.7.10