diff options
author | sbruno <sbruno@FreeBSD.org> | 2014-09-04 21:31:25 +0000 |
---|---|---|
committer | sbruno <sbruno@FreeBSD.org> | 2014-09-04 21:31:25 +0000 |
commit | aac1b9fa39cdc9e615d4247a61f1fb26f57cb983 (patch) | |
tree | d3c2dc164b6d44e35b244614d82c95f17b4628da /sys/kern/imgact_shell.c | |
parent | dd6e2ef2ad3fc3c2e81deaa331a7db2d50d8c222 (diff) | |
download | FreeBSD-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.c | 4 |
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. |