From nobody Wed May 22 03:03:54 2024 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 4Vkbjk28rfz5LQ19; Wed, 22 May 2024 03:03:54 +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 4Vkbjk1fHXz42dv; Wed, 22 May 2024 03:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716347034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uDczNObiLuSWXfecGuwZ1gdqm6KWwb/LS1+O/z3MI8Q=; b=vBnxR2p2Ixfo/PvOYRKLBhjSReIC+wh3jImHsmypP3c1e0VAiSkLn2nDPqqmbLy6/t67XA YJDvFhZgqfH1YWDYvJeqo3YPZYLChbfe4n3h4uKtG0HD2zKAHesiOcDrIqboNOM+KjYVnY d1qMsmGYlvTBzn3dXGBg+Il76gJSopyEoHDkZOTDn5ES+M+gHhuAK5ptFCE0YU3jZ6kgbj XjqTWb5ehRqGON5p9PnL9Bi7AYubW15d6094HlXlqIoLQuVLsllmWVr3q43LgV6sZIdv15 IEh3YYK5ly0a9QeUORdGu6tX9UjTvWJUM/u+Ww8QoXM4fQxvP1jZxWbdK5UjNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716347034; a=rsa-sha256; cv=none; b=AJpFDnzvitiapShrmKS+A39Jtxp+Y9BidGRt4OYLjOi8xXo4Qe76AhrK9jW51W/rTJUF/f 4MHrLpSbDTSbfj/0FRe+au6P4UE4aY758JIg26A/1S1skcBy1tgpMAv5pTGlJ3NE/+rFzd 1nj+Savdk5S0+HqPw1h4VLuZ6tYJFNrl1XdBb3tJ/EQuz9Ihz6vSR7MOT6dCsSVlcmkA56 B2OUWtPeFbnDRMn8w8Yps5GJF0WnDlVxWViq1RVDP93xK7HYLxhYmq55sXJky8ErsAUigL W63zQFYCGHVd/gZE8dlIxFyLLlPHisq90Q1yKe5yeuusWUHOpXaUXI+HO62wAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716347034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uDczNObiLuSWXfecGuwZ1gdqm6KWwb/LS1+O/z3MI8Q=; b=LWQOYTGGAMZiuWc1NSnK4Lva7QqPI+xu/RPAmpWJknRwlc6RBqDPdu+v7fpqTml4MJ6Xan P4APNYQa1pBzjpZYL096HNAGjltseZOlmAlDq6baHyJSaW90vxO3VuCeMsN6kc6kIrO5Ma bCV0riq5hWjnmWi7qLq7mQTa+twE+Xhc7DrzGBIw4QMOCzyV0arBZlAwtKFLyd6opiVaq9 Pm8RYDh9txqWDGPEV8FEw7gXgVe1GZCh0FQrjJc3IiSNrQOB1+LcLHHrqVivhfVspmM44c xyDGz6t8peGSMD5L2kwI3eWxh7JQAHde59Hv3I8vJhbpcctCtUQHat9C8JpfaQ== 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 4Vkbjk1FXPzpHJ; Wed, 22 May 2024 03:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44M33snm053441; Wed, 22 May 2024 03:03:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44M33s8c053438; Wed, 22 May 2024 03:03:54 GMT (envelope-from git) Date: Wed, 22 May 2024 03:03:54 GMT Message-Id: <202405220303.44M33s8c053438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pawel Jakub Dawidek Subject: git: 31223e68e299 - main - Simplify the code. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pjd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31223e68e299cc7dbef4573adb368918f260b6ef Auto-Submitted: auto-generated The branch main has been updated by pjd: URL: https://cgit.FreeBSD.org/src/commit/?id=31223e68e299cc7dbef4573adb368918f260b6ef commit 31223e68e299cc7dbef4573adb368918f260b6ef Author: Pawel Jakub Dawidek AuthorDate: 2024-05-19 01:58:14 +0000 Commit: Pawel Jakub Dawidek CommitDate: 2024-05-22 03:01:24 +0000 Simplify the code. Obtained from: Fudo Security Reviewed by: asomers, imp Approved by: oshogbo (mentor) Differential Revision: https://reviews.freebsd.org/D45247 --- sys/fs/fuse/fuse_vnops.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 3f8f3322162a..925838c89bcb 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -2248,19 +2248,14 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) return (err2); if (vap->va_uid != old_va.va_uid) return err; - else - accmode |= VADMIN; drop_suid = true; - } else - accmode |= VADMIN; - } else - accmode |= VADMIN; + } + accmode |= VADMIN; } if (vap->va_gid != (gid_t)VNOVAL) { if (checkperm && priv_check_cred(cred, PRIV_VFS_CHOWN)) drop_suid = true; - if (checkperm && !groupmember(vap->va_gid, cred)) - { + if (checkperm && !groupmember(vap->va_gid, cred)) { /* * Non-root users may only chgrp to one of their own * groups @@ -2274,11 +2269,8 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) return (err2); if (vap->va_gid != old_va.va_gid) return err; - accmode |= VADMIN; - } else - accmode |= VADMIN; - } else - accmode |= VADMIN; + } + accmode |= VADMIN; } if (vap->va_size != VNOVAL) { switch (vp->v_type) {