Date: Thu, 2 Oct 2014 21:19:13 +0000 (UTC) From: Sean Bruno <sbruno@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272450 - in stable/10/sys: kern sys Message-ID: <201410022119.s92LJDJo011206@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sbruno Date: Thu Oct 2 21:19:13 2014 New Revision: 272450 URL: https://svnweb.freebsd.org/changeset/base/272450 Log: 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) Modified: stable/10/sys/kern/imgact_binmisc.c stable/10/sys/kern/imgact_shell.c stable/10/sys/sys/imgact.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/imgact_binmisc.c ============================================================================== --- stable/10/sys/kern/imgact_binmisc.c Thu Oct 2 21:18:16 2014 (r272449) +++ stable/10/sys/kern/imgact_binmisc.c Thu Oct 2 21:19:13 2014 (r272450) @@ -600,12 +600,12 @@ imgact_binmisc_exec(struct image_params } /* 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; Modified: stable/10/sys/kern/imgact_shell.c ============================================================================== --- stable/10/sys/kern/imgact_shell.c Thu Oct 2 21:18:16 2014 (r272449) +++ stable/10/sys/kern/imgact_shell.c Thu Oct 2 21:19:13 2014 (r272450) @@ -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. Modified: stable/10/sys/sys/imgact.h ============================================================================== --- stable/10/sys/sys/imgact.h Thu Oct 2 21:18:16 2014 (r272449) +++ stable/10/sys/sys/imgact.h Thu Oct 2 21:19:13 2014 (r272450) @@ -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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410022119.s92LJDJo011206>