summaryrefslogtreecommitdiffstats
path: root/package/audit/0004-Do-not-call-posix_fallocate-if-unavailable.patch
diff options
context:
space:
mode:
authorClayton Shotwell <clayton.shotwell@rockwellcollins.com>2015-06-02 08:28:20 -0500
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-06-17 23:34:09 +0200
commit6158928a4e4b7dcdd022731d3ff9304a49bcf357 (patch)
tree6fe32d9f26ac11beec6361d8b9d83d60316fe49b /package/audit/0004-Do-not-call-posix_fallocate-if-unavailable.patch
parentdad81a3abf5ebfc2a7ea0722edb484f4e37af3ba (diff)
downloadbuildroot-6158928a4e4b7dcdd022731d3ff9304a49bcf357.tar.gz
buildroot-6158928a4e4b7dcdd022731d3ff9304a49bcf357.zip
audit: new package
[Thomas: - remove S01audit, which isn't completely compliant with the Buildroot style. - make the package available only on architectures for which the system call tables are available, and add some comments about this in the .mk file.] Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/audit/0004-Do-not-call-posix_fallocate-if-unavailable.patch')
-rw-r--r--package/audit/0004-Do-not-call-posix_fallocate-if-unavailable.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/package/audit/0004-Do-not-call-posix_fallocate-if-unavailable.patch b/package/audit/0004-Do-not-call-posix_fallocate-if-unavailable.patch
new file mode 100644
index 0000000000..4bb27a436e
--- /dev/null
+++ b/package/audit/0004-Do-not-call-posix_fallocate-if-unavailable.patch
@@ -0,0 +1,47 @@
+From 3f44df90f60c692127f84de090cd5337f627e1c2 Mon Sep 17 00:00:00 2001
+From: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
+Date: Wed, 1 Apr 2015 07:49:54 -0500
+Subject: [PATCH] Do not call posix_fallocate() if unavailable
+
+uClibc does not implement posix_fallocate(), and posix_fallocate() is
+mostly only an hint to the kernel that we will need such or such
+amount of space inside a file. Adding a check around the
+posix_fallocate() call so it is only called when it is available.
+
+Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
+---
+ audisp/plugins/remote/queue.c | 2 ++
+ configure.ac | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/audisp/plugins/remote/queue.c b/audisp/plugins/remote/queue.c
+index 79eebd7..971e4e4 100644
+--- a/audisp/plugins/remote/queue.c
++++ b/audisp/plugins/remote/queue.c
+@@ -215,9 +215,11 @@ static int q_open_file(struct queue *q, const char *path)
+ return -1;
+ if (q_sync(q) != 0)
+ return -1;
++#ifdef HAVE_POSIX_FALLOCATE
+ if (posix_fallocate(q->fd, 0,
+ (q->num_entries + 1) * q->entry_size) != 0)
+ return -1;
++#endif
+ } else {
+ uint32_t file_entries;
+ if (full_pread(q->fd, &fh, sizeof(fh), 0) != 0)
+diff --git a/configure.ac b/configure.ac
+index 57aec03..c14ec80 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -67,6 +67,7 @@ AC_CHECK_DECLS([MS_DIRSYNC], [], [], [[#include <sys/mount.h>]])
+ AC_CHECK_DECLS([AUDIT_FEATURE_VERSION], [], [], [[#include <linux/audit.h>]])
+ AC_CHECK_DECLS([AUDIT_VERSION_BACKLOG_WAIT_TIME], [], [], [[#include <linux/audit.h>]])
+ AC_CHECK_DECLS([ADDR_NO_RANDOMIZE],,, [#include <sys/personality.h>])
++AC_CHECK_FUNCS([posix_fallocate])
+
+ ALLWARNS=""
+ ALLDEBUG="-g"
+--
+1.9.1
+
OpenPOWER on IntegriCloud