From nobody Tue Feb 28 06:14:04 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 4PQnBR5xP4z3v2M8 for ; Tue, 28 Feb 2023 06:14:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PQnBR5SLMz3Fdd; Tue, 28 Feb 2023 06:14:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677564847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zAcph2860fJcvNhS01orJIB2JOQGtwEx0dKV5fRHJq0=; b=HO+3DP6YJQhgt39TQyOhQVq2YYV//4jJM7NQRx0UbLucTf/+RKITJewyrxfAJRUJoKyINf yPvATO2cXf3IgvO3+tAWkuRL3M36wg6Sm0RyDpBYjfAaOzxBM0MktVXNQEbOIvT8MAM0qf erDkmoVtV/Jw2e/VZYjmEZSnGvwNACvOijyftfqtFVr5rw5wpmKF4bluC3QwLLweWpTe/s p70BJdwjckjWs+VItRfgmVoO4NqTXu1luy3Or3fYQ3lKIJugrsIoSQNBXH7948gc7P/PxZ 0C5NDfqa1Ta+3wCIEkWCFZBVsRwkKVSJHnsBKDmhSX9TDYielM8oG8Zyo2l1qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677564847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zAcph2860fJcvNhS01orJIB2JOQGtwEx0dKV5fRHJq0=; b=AVJH4T+yyoAhNqwc5TrrS6knDgrU68CKaSuG2x70Ptlt1QiD2g4A5kNQrdWzF0vo9aFlkc bF6fMyLmI9fG4/sXgzML3GRs9YxZtImP1x5ZwbMoVVISkQCtqtSayBJJWTdxPeTRmrO7ZO fgI9R4SihQhQaifpHIxEsDlv7XPYautncL1fflq2Jl4uv6w/l4yEh2Tri8CuJMlaW8kU9K cguozhUPvMkts/dlNRBqeiIuxzCVPdNjlZLnyxVL6j1vN4gaFYMH9u3+LcISEmmOuIJ64t w0Q77IWK6uBUU4gdiU1/AFuw0VLItinDc1RUnDryf9+z36B5m9TrdLL1APkXvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677564847; a=rsa-sha256; cv=none; b=H9VXeUSBSfpJWsio29JSPldWwz0Me+IS7jhhtJUfeeKYWmhJeJo+5qTiwEKgxOa9ITegTa jmmoLI5NgTLRiFpn5rkK/8rqcm+OBiAVdK+Ct4EhrB4c6CFDLWWWWMDO9VHWkBGQdoRX/0 +IAOj6t0FVHUK0cWdz7SD4/7jwodiY0xVjk7YQXCXKNYn6f73RqUaAq5BoS2S8ewpdb5UY dWoVw+VHJa3ubeax7LanLb6q4TLDdrRevlcLo8l/DZiMkKiDgLfQ33JITrRkY9K1RGkRgg NVI2Mf/QbBNUrN0d/PpK24LmhVoi0EawkaM2FXEQSA/AAaZCWfPO7OmOIMvjbQ== Received: from odin.corp.delphij.net (c-141-193-140-175.rev.sailinternet.net [141.193.140.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: delphij/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PQnBR2PGvzQ8f; Tue, 28 Feb 2023 06:14:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Message-ID: Date: Mon, 27 Feb 2023 22:14:04 -0800 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 User-Agent: Thunderbird Subject: Re: git: 39e8c2a29a86 - main - cleanvar: Be more careful when cleaning up /var. Content-Language: en-US To: "Piotr P. Stefaniak" Cc: dev-commits-src-main@freebsd.org References: <202302130457.31D4v8Hh067792@gitrepo.freebsd.org> From: Xin Li Organization: The FreeBSD Project In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 2023-02-27 3:51 PM, Piotr P. Stefaniak wrote: > On 2023-02-13 04:57:08, Xin LI wrote: >>    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. > >> @@ -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 > > Do we want to assume that /var/run is never a symlink? If not, we > probably want to use find -xH here. No, I don't think it's safe to follow symlinks. If it's desirable to follow /var/run itself, perhaps this should be changed to "/var/run/".