summaryrefslogtreecommitdiff
path: root/usr.bin/strip
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-03 06:54:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-03 06:54:44 +0000
commit3ed56de53e8d89686c93538c29f1d0ed22d50e4e (patch)
tree209a07f4ce64998450b2ec7422f2ec6c3284b09c /usr.bin/strip
parent1097f6f628ff158181af7aa67f3f74aac76a5c64 (diff)
check mid of exec too
Diffstat (limited to 'usr.bin/strip')
-rw-r--r--usr.bin/strip/strip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/strip/strip.c b/usr.bin/strip/strip.c
index a2763d2a888..ad00cbbe3f2 100644
--- a/usr.bin/strip/strip.c
+++ b/usr.bin/strip/strip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strip.c,v 1.2 1996/06/26 05:39:32 deraadt Exp $ */
+/* $OpenBSD: strip.c,v 1.3 1996/09/03 06:54:43 deraadt Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)strip.c 5.8 (Berkeley) 11/6/91";*/
-static char rcsid[] = "$OpenBSD: strip.c,v 1.2 1996/06/26 05:39:32 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: strip.c,v 1.3 1996/09/03 06:54:43 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -113,7 +113,7 @@ main(argc, argv)
(void)close(fd);
ERROR(errno);
}
- if (N_BADMAG(*ep)) {
+ if (N_BADMAG(*ep) || N_GETMID(*ep) != MID_MACHINE) {
munmap((caddr_t)ep, sb.st_size);
(void)close(fd);
ERROR(EFTYPE);