lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1435360289-22531-1-git-send-email-vlee@twopensource.com>
Date:	Fri, 26 Jun 2015 16:11:27 -0700
From:	Vinson Lee <vlee@...pensource.com>
To:	Shuah Khan <shuahkh@....samsung.com>,
	David Drysdale <drysdale@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Michael Ellerman <mpe@...erman.id.au>
Cc:	linux-api@...r.kernel.org, linux-kernel@...r.kernel.org,
	Vinson Lee <vlee@...tter.com>
Subject: [PATCH v2] selftests/exec: Fix build on older distros.

From: Vinson Lee <vlee@...tter.com>

This patch fixes this build error on CentOS 5.

execveat.c: In function ‘check_execveat_pathmax’:
execveat.c:185: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)
execveat.c:185: error: (Each undeclared identifier is reported only once
execveat.c:185: error: for each function it appears in.)
execveat.c: In function ‘run_tests’:
execveat.c:221: error: ‘O_PATH’ undeclared (first use in this function)
execveat.c:222: error: ‘O_CLOEXEC’ undeclared (first use in this function)
execveat.c:258: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function)

Cc: stable@...r.kernel.org # 3.19+
Signed-off-by: Vinson Lee <vlee@...tter.com>
---
 tools/testing/selftests/exec/execveat.c | 34 +++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c
index 8d5d1d2..30d2555 100644
--- a/tools/testing/selftests/exec/execveat.c
+++ b/tools/testing/selftests/exec/execveat.c
@@ -20,6 +20,40 @@
 #include <string.h>
 #include <unistd.h>
 
+#if defined( __alpha__)
+# ifndef O_CLOEXEC
+#  define O_CLOEXEC	010000000
+# endif
+# ifndef O_PATH
+#  define O_PATH	040000000
+# endif
+#elif defined(__hppa__)
+# ifndef O_CLOEXEC
+#  define O_CLOEXEC	010000000
+# endif
+# ifndef O_PATH
+#  define O_PATH	020000000
+# endif
+#elif defined(__sparc__)
+# ifndef O_CLOEXEC
+#  define O_CLOEXEC	0x400000
+# endif
+# ifndef O_PATH
+#  define O_PATH 	0x1000000
+# endif
+#else
+# ifndef O_CLOEXEC
+#  define O_CLOEXEC	02000000
+# endif
+# ifndef O_PATH
+#  define O_PATH	010000000
+# endif
+#endif
+
+#ifndef AT_EMPTY_PATH
+# define AT_EMPTY_PATH	0x1000
+#endif
+
 static char longpath[2 * PATH_MAX] = "";
 static char *envp[] = { "IN_TEST=yes", NULL, NULL };
 static char *argv[] = { "execveat", "99", NULL };
-- 
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ