summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-05-09 19:13:03 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-05-09 19:13:03 +0000
commita58ac6b9916fc64d49516fc50e9133c04064cbc2 (patch)
treea15a2c85e4034c9d91f4802600e185d7af5f5d32
parenta7b11bf01f1ed38cd8f930b5a53b0497a88feead (diff)
Fix noexec option on ELF systems
-rw-r--r--usr.bin/rdist/Makefile6
-rw-r--r--usr.bin/rdist/isexec.c7
-rw-r--r--usr.bin/rdist/os-openbsd.h4
3 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/rdist/Makefile b/usr.bin/rdist/Makefile
index 8fa4637c1a2..56f2ec2982b 100644
--- a/usr.bin/rdist/Makefile
+++ b/usr.bin/rdist/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.11 2001/08/31 23:31:30 millert Exp $
+# $OpenBSD: Makefile,v 1.12 2002/05/09 19:13:02 millert Exp $
PROG= rdist
@@ -12,4 +12,8 @@ DPADD= ${LIBCOMPAT}
.include <bsd.prog.mk>
+.if ${ELF_TOOLCHAIN} == "yes"
+CFLAGS+=-DEXE_TYPE=EXE_ELF
+.endif
+
.depend: gram.c
diff --git a/usr.bin/rdist/isexec.c b/usr.bin/rdist/isexec.c
index 9abbd21b8ad..251778d85f5 100644
--- a/usr.bin/rdist/isexec.c
+++ b/usr.bin/rdist/isexec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isexec.c,v 1.4 1998/06/26 21:21:12 millert Exp $ */
+/* $OpenBSD: isexec.c,v 1.5 2002/05/09 19:13:02 millert Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -38,7 +38,7 @@ static char RCSid[] =
"$From: isexec.c,v 6.21 1994/04/01 23:44:10 mcooper Exp $";
#else
static char RCSid[] =
-"$OpenBSD: isexec.c,v 1.4 1998/06/26 21:21:12 millert Exp $";
+"$OpenBSD: isexec.c,v 1.5 2002/05/09 19:13:02 millert Exp $";
#endif
static char sccsid[] = "@(#)client.c";
@@ -75,7 +75,7 @@ static int _isexec(fd)
/*
* Elf
*/
-#include <elf.h>
+#include <elf_abi.h>
#define ISELF(h) (h.e_type == ET_EXEC)
#endif /* EXE_ELF_AND_COFF || EXE_ELF */
@@ -122,7 +122,6 @@ typedef union {
/*
* Elf
*/
-#include <elf.h>
typedef Elf32_Ehdr hdr_t;
#endif /* EXE_TYPE == EXE_ELF */
diff --git a/usr.bin/rdist/os-openbsd.h b/usr.bin/rdist/os-openbsd.h
index b32f89ef220..a8034a820a7 100644
--- a/usr.bin/rdist/os-openbsd.h
+++ b/usr.bin/rdist/os-openbsd.h
@@ -33,7 +33,7 @@
*/
/*
- * $OpenBSD: os-openbsd.h,v 1.10 1998/06/26 21:21:16 millert Exp $
+ * $OpenBSD: os-openbsd.h,v 1.11 2002/05/09 19:13:02 millert Exp $
*/
/*
@@ -85,7 +85,9 @@
/*
* Select the type of executable file format.
*/
+#ifndef EXE_TYPE
#define EXE_TYPE EXE_AOUT
+#endif
/*
* Select the type of statfs() system call (if any).