summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_shell.c
diff options
context:
space:
mode:
authorsbruno <sbruno@FreeBSD.org>2014-09-04 21:31:25 +0000
committersbruno <sbruno@FreeBSD.org>2014-09-04 21:31:25 +0000
commitaac1b9fa39cdc9e615d4247a61f1fb26f57cb983 (patch)
treed3c2dc164b6d44e35b244614d82c95f17b4628da /sys/kern/imgact_shell.c
parentdd6e2ef2ad3fc3c2e81deaa331a7db2d50d8c222 (diff)
downloadFreeBSD-src-aac1b9fa39cdc9e615d4247a61f1fb26f57cb983.zip
FreeBSD-src-aac1b9fa39cdc9e615d4247a61f1fb26f57cb983.tar.gz
Allow multiple image activators to run on the same execution by changing
imgp->interpreted to a bitmask instead of, functionally, a bool. Each imgactivator now requires its own flag in interpreted to indicate whether or not it has already examined argv[0]. Change imgp->interpreted to an unsigned char to add one extra bit for future use. With this change, one can execute a shell script from a 64bit host native make and still get the binmisc image activator to fire for the script interpreter. Prior to this, execution would fail. Phabric: https://reviews.freebsd.org/D696 Reviewed by: jhb@ MFC after: 4 weeks
Diffstat (limited to 'sys/kern/imgact_shell.c')
-rw-r--r--sys/kern/imgact_shell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/imgact_shell.c b/sys/kern/imgact_shell.c
index d9884f5..aaf521c 100644
--- a/sys/kern/imgact_shell.c
+++ b/sys/kern/imgact_shell.c
@@ -115,10 +115,10 @@ exec_shell_imgact(imgp)
* Don't allow a shell script to be the shell for a shell
* script. :-)
*/
- if (imgp->interpreted)
+ if (imgp->interpreted & IMGACT_SHELL)
return (ENOEXEC);
- imgp->interpreted = 1;
+ imgp->interpreted |= IMGACT_SHELL;
/*
* At this point we have the first page of the file mapped.
OpenPOWER on IntegriCloud