SHA256
1
0
forked from pool/audit

Accepting request 49204 from home:a_jaeger:branches:openSUSE:Factory

Passt. :-)

OBS-URL: https://build.opensuse.org/request/show/49204
OBS-URL: https://build.opensuse.org/package/show/security/audit?expand=0&rev=18
This commit is contained in:
Roman Drahtmueller 2010-09-27 12:04:27 +00:00 committed by Git OBS Bridge
parent e335f1c6d6
commit 426a43d7b5
3 changed files with 28 additions and 0 deletions

21
audit-oom_score_adj.patch Normal file
View File

@ -0,0 +1,21 @@
Index: src/auditd.c
===================================================================
--- src/auditd.c.orig
+++ src/auditd.c
@@ -265,7 +265,15 @@ static int write_pid_file(void)
static void avoid_oom_killer(void)
{
int oomfd;
-
+
+ /* Newer kernels (noticed in 2.6.36) */
+ oomfd = open("/proc/self/oom_score_adj", O_NOFOLLOW | O_WRONLY);
+ if (oomfd >= 0) {
+ (void)write(oomfd, "0", 1);
+ close(oomfd);
+ return;
+ }
+ /* Older kernel */
oomfd = open("/proc/self/oom_adj", O_NOFOLLOW | O_WRONLY);
if (oomfd >= 0) {
(void)write(oomfd, "-17", 3);

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Sep 27 08:47:32 UTC 2010 - aj@suse.de
- Use /proc/<pid>/oom_score_adj if available.
-------------------------------------------------------------------
Mon Jun 28 06:38:35 UTC 2010 - jengelh@medozas.de

View File

@ -36,6 +36,7 @@ Patch1: audit-no_python.patch
Patch2: audit-no_plugins.patch
Patch3: audit-no-gss.patch
Patch4: audit-as_needed.patch
Patch5: audit-oom_score_adj.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: %{name}-libs = %{version}
PreReq: %insserv_prereq %fillup_prereq
@ -100,6 +101,7 @@ Authors:
%patch2 -p1
%patch3 -p1
%patch4
%patch5
%build
autoreconf -fi