From nobody Sat Nov 06 02:25:17 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1FF84183BED9; Sat, 6 Nov 2021 02:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HmLnV1wLnz3jDB; Sat, 6 Nov 2021 02:25:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1005322F6A; Sat, 6 Nov 2021 02:25:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A62PHJk077393; Sat, 6 Nov 2021 02:25:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A62PH05077392; Sat, 6 Nov 2021 02:25:17 GMT (envelope-from git) Date: Sat, 6 Nov 2021 02:25:17 GMT Message-Id: <202111060225.1A62PH05077392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 184936164435 - stable/13 - struct image_params: use bool type for boolean members List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 18493616443539ccef910e7af0c8f65c9208ba9f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=18493616443539ccef910e7af0c8f65c9208ba9f commit 18493616443539ccef910e7af0c8f65c9208ba9f Author: Konstantin Belousov AuthorDate: 2021-10-23 15:05:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-06 02:12:31 +0000 struct image_params: use bool type for boolean members (cherry picked from commit 15bf81f354a428723d7e9ea61ea215d4195aa050) --- sys/kern/kern_exec.c | 6 +++--- sys/sys/imgact.h | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 1fd11e34a048..9b8ee7025a94 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -654,7 +654,7 @@ interpret: #endif if (imgp->opened) { VOP_CLOSE(newtextvp, FREAD, td->td_ucred, td); - imgp->opened = 0; + imgp->opened = false; } vput(newtextvp); vm_object_deallocate(imgp->object); @@ -1092,7 +1092,7 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) vm_prot_t stack_prot; u_long ssiz; - imgp->vmspace_destroyed = 1; + imgp->vmspace_destroyed = true; imgp->sysent = sv; if (p->p_sysent->sv_onexec_old != NULL) @@ -1855,7 +1855,7 @@ exec_check_permissions(struct image_params *imgp) */ error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL); if (error == 0) - imgp->opened = 1; + imgp->opened = true; return (error); } diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index cd130551c050..9e884ef08d96 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -59,21 +59,16 @@ struct image_args { }; struct image_params { - struct proc *proc; /* our process struct */ + struct proc *proc; /* our process */ struct label *execlabel; /* optional exec label */ - struct vnode *vp; /* pointer to vnode of file to exec */ + struct vnode *vp; /* pointer to vnode of file to exec */ struct vm_object *object; /* The vm object for this vp */ - struct vattr *attr; /* attributes of file */ - const char *image_header; /* head of file to exec */ - 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 */ -#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 */ + struct vattr *attr; /* attributes of file */ + const char *image_header; /* header of file to exec */ + unsigned long entry_addr; /* entry address of target executable */ + unsigned long reloc_base; /* load address of image */ + char *interpreter_name; /* name of the interpreter */ + void *auxargs; /* ELF Auxinfo structure pointer */ struct sf_buf *firstpage; /* first page that we mapped */ void *ps_strings; /* pointer to ps_string (user space) */ struct image_args *args; /* system call arguments */ @@ -91,7 +86,12 @@ struct image_params { u_long stack_sz; u_long eff_stack_sz; struct ucred *newcred; /* new credentials if changing */ +#define IMGACT_SHELL 0x1 +#define IMGACT_BINMISC 0x2 + unsigned char interpreted; /* mask of interpreters that have run */ bool credential_setid; /* true if becoming setid */ + bool vmspace_destroyed; /* we've blown away original vm space */ + bool opened; /* we have opened executable vnode */ bool textset; u_int map_flags; };