From nobody Tue Feb 21 15:38:08 2023 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 4PLk2T2D1Lz3snh4; Tue, 21 Feb 2023 15:38:09 +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 4PLk2T1VPMz3Gft; Tue, 21 Feb 2023 15:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676993889; 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=gYCoq9dk7tuLVOBVFqHuuxDpIVa43XIEeZGeAWLZoKM=; b=pFzdJwR1UrFQutS9fUhnwmkvkjOMdCc+JNpJ4nMKpZ/LpLoJ1dQ+VvRu0IH1fJThAl8k8v bOVPhFcgc4uPbEAVzbVRgYRB9sl19EiNfVGrgqqs7XQrc6wNdngDLKFwp2yffLr57z8/Ea jtk3Dy5g94xNf7wIowNch6DVXNnSrLWr5CjFpLR9HdEs5X3DLsEjZ7ImtZAg4gszl0wXRr no3bAGq/ZVLBvNLpHdJNCno9C8g8TMq0tllK18MdomjhoNQyB0IFQhtg+/6OTdDcKsBfIR wwdSYdjAFsT4GRzclQlWrHtpVqJa2kXrJTn/9ydfJOp0qGG2CSuwTTp2x79sNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676993889; 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=gYCoq9dk7tuLVOBVFqHuuxDpIVa43XIEeZGeAWLZoKM=; b=DtQPSXviGfcz5m3RbzrO1phVxbqXY2PU8BsRtnsNrZlVYubJG6B1JGqQP73Edl6xsE3qsQ M7lIqOoIoSmixxedZRiMZu8S3yMLs1fAHpa5hAATJkxDg0NlTLPzpBKxbGhRIsgVyp5bS4 hIwGlj1OR2meX42LotinBARBnALI147wvDgJPwrGm9yxVsjz5bPrQvKxGHyyAUsBxbTVlI ZsV3qaAF07JrPalz/Q0GtUDS+ho6Q5hwgu+d8Ks8B1KHEK6A76n3zvA1sZh4eW+0QfuXYn 8Fwbxec6+gLVgAycxlvtOTpasKs1KgiKFz5HYiIs9BcDXeS5qkpNWw6iTWAUrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676993889; a=rsa-sha256; cv=none; b=T/htfU2DWAkf0gs8IHHLkc9nzYhrJRD+62/i8On04K/tABT+z5PjG59T1uFAQD6iGdoLt3 nyEc1IhtvZbSS4rsazDDmJR/bnNm3TUnWgm9WuG5piIeiid1dU67ZG7WXFn6IB9tneKgau U0tYSsQ0mPwI4aJNfOlt03+q+Kb4zvG/O4oll0YetKGl81PaGykD2rv1XoDfEZEu0gSYSu hOo3JAfgdHClftGELZEHzseP/6rKZAOFmrhehTnoyJGWRV8C1AX9W2btAy+Uxu5088SL7o MAzdg8nSLAZwYZr7BwGgQltmQUpl3MtAPQO9jmBvYIO5QfquIVfJvSl3rHrVUw== 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 4PLk2T0ZLpzQc0; Tue, 21 Feb 2023 15:38:09 +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 31LFc8RO050867; Tue, 21 Feb 2023 15:38:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LFc8oE050866; Tue, 21 Feb 2023 15:38:08 GMT (envelope-from git) Date: Tue, 21 Feb 2023 15:38:08 GMT Message-Id: <202302211538.31LFc8oE050866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 57c37babde36 - releng/13.2 - cleanvar: Be more careful when cleaning up /var. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 57c37babde3664c81bc30ec5086092ae950aab49 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=57c37babde3664c81bc30ec5086092ae950aab49 commit 57c37babde3664c81bc30ec5086092ae950aab49 Author: Xin LI AuthorDate: 2023-02-13 04:56:17 +0000 Commit: Xin LI CommitDate: 2023-02-21 15:37:30 +0000 cleanvar: Be more careful when cleaning up /var. The cleanvar script uses find -delete to remove stale files under /var, which could lead to unwanted removal of files in some unusual scenarios. For example, when a mounted fdescfs(5) is present under /var/run/samba/fd, find(1) could descend into a directory that is out of /var/run and remove files that should not be removed. To mitigate this, modify the script to use find -x, which restricts the find scope to one file system only instead of descending into mounted file systems. PR: 269213 Approved by: re (cperciva) (cherry picked from commit 39e8c2a29a860bdb69ffcfbc06de4d4ad103b458) (cherry picked from commit 0699f0d43416776d87d20d7953b7d686f1e2e572) --- libexec/rc/rc.d/cleanvar | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rc/rc.d/cleanvar b/libexec/rc/rc.d/cleanvar index fcfd365268c3..a682021ce5f6 100755 --- a/libexec/rc/rc.d/cleanvar +++ b/libexec/rc/rc.d/cleanvar @@ -31,15 +31,15 @@ cleanvar_start() { if [ -d /var/run -a ! -f /var/run/clean_var ]; then # Skip over logging sockets - find /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete + find -x /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete >/var/run/clean_var fi if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then - find /var/spool/lock -type f -delete + find -x /var/spool/lock -type f -delete >/var/spool/lock/clean_var fi if [ -d /var/spool/uucp/.Temp ]; then - find /var/spool/uucp/.Temp -delete + find -x /var/spool/uucp/.Temp -delete fi }