diff options
author | sbruno <sbruno@FreeBSD.org> | 2014-10-02 21:19:13 +0000 |
---|---|---|
committer | sbruno <sbruno@FreeBSD.org> | 2014-10-02 21:19:13 +0000 |
commit | 3e8c118a1409af8246672b3e0c6cffa3d06f4209 (patch) | |
tree | fae1ff48fc3e296ea5b96675db22b5684f4194ec | |
parent | 28944a4ef0cb8062b8e9f2443c7fd3ded887391c (diff) | |
download | FreeBSD-src-3e8c118a1409af8246672b3e0c6cffa3d06f4209.zip FreeBSD-src-3e8c118a1409af8246672b3e0c6cffa3d06f4209.tar.gz |
MFC r271141: Allow multiple image activators to run on the same
execution by changing imgp->interpreted to a bitmask instead of,
functionally, a bool.
Approved by: re (gjb)
-rw-r--r-- | sys/kern/imgact_binmisc.c | 4 | ||||
-rw-r--r-- | sys/kern/imgact_shell.c | 4 | ||||
-rw-r--r-- | sys/sys/imgact.h | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/imgact_binmisc.c b/sys/kern/imgact_binmisc.c index 6d5cca2..5f324d3 100644 --- a/sys/kern/imgact_binmisc.c +++ b/sys/kern/imgact_binmisc.c @@ -600,12 +600,12 @@ imgact_binmisc_exec(struct image_params *imgp) } /* No interpreter nesting allowed. */ - if (imgp->interpreted) { + if (imgp->interpreted & IMGACT_BINMISC) { mtx_unlock(&interp_list_mtx); return (ENOEXEC); } - imgp->interpreted = 1; + imgp->interpreted |= IMGACT_BINMISC; if (imgp->args->fname != NULL) { fname = imgp->args->fname; 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. diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index 17cfcc2..8440939 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -61,7 +61,9 @@ struct image_params { unsigned long entry_addr; /* entry address of target executable */ unsigned long reloc_base; /* load address of image */ char vmspace_destroyed; /* flag - we've blown away original vm space */ - char interpreted; /* flag - this executable is interpreted */ +#define IMGACT_SHELL 0x1 +#define IMGACT_BINMISC 0x2 + unsigned char interpreted; /* mask of interpreters that have run */ char opened; /* flag - we have opened executable vnode */ char *interpreter_name; /* name of the interpreter */ void *auxargs; /* ELF Auxinfo structure pointer */ |