~ubuntu-branches/ubuntu/karmic/policykit/karmic

« back to all changes in this revision

Viewing changes to debian/patches/02_noptrace.patch.disabled

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2008-04-16 12:48:03 UTC
  • Revision ID: james.westby@ubuntu.com-20080416124803-gt28szv63pwj1f3z
Tags: 0.7-2ubuntu7
Re-enable 02_noptrace.patch again for the final release, where security
matters more than getting core dumps (apport is disabled by default in the
final release anyway). (LP: #207151)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Description: Disable ptrace() and core dumping for programs using libpolkit
2
 
# Ubuntu: https://wiki.ubuntu.com/DesktopTeam/Specs/PolicyKitIntegration
3
 
# Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=13742
4
 
 
5
 
--- policykit-0.7/src/polkit/polkit-policy-default.c    2007-11-28 22:22:52.000000000 +0100
6
 
+++ policykit-0.7.new/src/polkit/polkit-policy-default.c        2007-12-31 18:14:45.000000000 +0100
7
 
@@ -39,6 +39,7 @@
8
 
 #include <grp.h>
9
 
 #include <unistd.h>
10
 
 #include <errno.h>
11
 
+#include <sys/prctl.h>
12
 
 
13
 
 #include "polkit-debug.h"
14
 
 #include "polkit-error.h"
15
 
@@ -570,3 +571,14 @@
16
 
 };
17
 
 
18
 
 #endif /* POLKIT_BUILD_TESTS */
19
 
+
20
 
+/**
21
 
+ * Library constructor: Disable ptrace() and core dumping for applications
22
 
+ * which use this library, so that local trojans cannot silently abuse PK
23
 
+ * privileges. (This is a just a bandaid, not a robust solution).
24
 
+ */
25
 
+__attribute__ ((constructor))
26
 
+void init()
27
 
+{
28
 
+        prctl(PR_SET_DUMPABLE, 0);
29
 
+}