From owner-svn-src-stable-10@FreeBSD.ORG Thu Oct 2 21:19:14 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B064AD2D; Thu, 2 Oct 2014 21:19:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8277C295; Thu, 2 Oct 2014 21:19:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s92LJEf7011209; Thu, 2 Oct 2014 21:19:14 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92LJDJo011206; Thu, 2 Oct 2014 21:19:13 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201410022119.s92LJDJo011206@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 2 Oct 2014 21:19:13 +0000 (UTC) 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 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2014 21:19:14 -0000 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 */