From nobody Mon Feb 13 04:57:08 2023 X-Original-To: dev-commits-src-main@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 4PFXBY0PNlz3qY6j; Mon, 13 Feb 2023 04:57: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 4PFXBX6ls8z45j5; Mon, 13 Feb 2023 04:57:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676264229; 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=2xjpDPC6fqHVl52q1mnaXuAG608gjfZ53vU3BaGJDwI=; b=yvnSB70dg1BYhBVSxP/j7aR6fqticZcHXyDvLzsG9CwtO3hT25hoVFzMk2/ikh23MhPjMd pm9xEV6IIJz33As6FBjwp2tAjEA4AxJMLHXHvMc7e4wzANR2aJPxWfRcyrvP4CTGy1uzvr OA6Bhh7a0H2CpF0g0FWbUXU4X+A/Rqt5SbaNSsIq6g9y28b0nWhlpx5859PEyc5KhQ3XTK +POU4012UiD4rpA7ptMHjgUlIkBeCgVIsqz5zl8Boc/AKjL9QdKq/8EMQJkQgweD0hi81T DW9zss9ab5SSro62/JrMgqZSyLW8aeT9m72lC2MXIyXvSz6UVAdGJC1BAgbvlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676264228; 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=2xjpDPC6fqHVl52q1mnaXuAG608gjfZ53vU3BaGJDwI=; b=tyIm8t1+oHO8LPpn9uEyXr82QFOFGAQvi+CmPKP9JVK0VntXrDoxAJJFD2KTk9+7dGBoTm w6BV1aaeXZo+GCCf7blm84U+9p/vu7DpYenLqLMxSXXBaMgZIWwopyEE1xV+jSOqDiDmpY G0SUSoR8s2rTS3qsyH5CDdFO6FOpYOUhW5mlRwX8CPuCnLu7Wht2RSoOki26ie2Rzc2nQn riaBaF8nHg1XIGBkS/YtkFu9auPLyRsvXs8N1M6WhTjeO5yIHSq022uID3bfsjAXlDZDMg rIei4QtGM1L+J94/YaBjXZM/RUyF+b4nn9qyiwtWIZehlgajtKkPTnXvoNe/iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676264228; a=rsa-sha256; cv=none; b=ccAXN5dSlEjlfmlVSSDih0JWdCzUq3UUpPLHYKENut7pT9DUl5jKtyPow8czxKk0pdZTQi gmRa3dFvN8iudJ2wkARQ2p28pgNsNbgi0/a8QNoqsZb0AfoqKEKewOaTG9Ae6z7B3Xv05A 35R/C/DxdJEofqumY0eyjJdQhwOZ+/vqqLLdoyhj/1P3fcC3gd3K8fJ5yncEyZm/TQiGlx PzNUrFeB2BMeLN82mnLGJ1P0W93daj75FqMLTVUWd8p8KEBGjYRAnzQKwz8kqyIyrKHHwM bKQsDiyF9WMuKJ2cLxyXZ+4pEIE0PcchhTL2LJ2x4gS5b40aocTp+6Ky1yYXCw== 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 4PFXBX5pVMz1525; Mon, 13 Feb 2023 04:57:08 +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 31D4v8Mr067793; Mon, 13 Feb 2023 04:57:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31D4v8Hh067792; Mon, 13 Feb 2023 04:57:08 GMT (envelope-from git) Date: Mon, 13 Feb 2023 04:57:08 GMT Message-Id: <202302130457.31D4v8Hh067792@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 39e8c2a29a86 - main - cleanvar: Be more careful when cleaning up /var. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 39e8c2a29a860bdb69ffcfbc06de4d4ad103b458 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=39e8c2a29a860bdb69ffcfbc06de4d4ad103b458 commit 39e8c2a29a860bdb69ffcfbc06de4d4ad103b458 Author: Xin LI AuthorDate: 2023-02-13 04:56:17 +0000 Commit: Xin LI CommitDate: 2023-02-13 04:56:17 +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 MFC after: 1 week --- 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 }