From nobody Thu Feb 8 19:27:57 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 4TW6T93Hz4z5BFkh; Thu, 8 Feb 2024 19:27:57 +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 4TW6T92VcLz4phk; Thu, 8 Feb 2024 19:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707420477; 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=WscErq0bCIm2/PGCCNg2Vemi91rvBgZaO3iCO24vmWU=; b=AoWmr0zSVpIxE2hQJ5q3R2BiE9TLsCCBo+xtGwLdJYpZiOeRWOocUU42BacQtIyI65B8kz 0IY6B9LMN3oRHtutb409g0VFPc8iGhvb1jA/3I7qyWxMbHgpVsvC4kVDARzIw/aAd3WbPj 9B+usjs+4NN4woyU/VuI6FMsyenP7e12mfrYa6JnLU37OGr/kmNhc3jO8/QUd4y03RhUeS 4Uv6t3ijj6ZmrqcTNqPOWotagKzTtR3ym7wREm2q12ZR3D+Kg+I4hDXJn5tDSNGxsnluEf sS+sqz5WECmBywP7m8lVVsOH1wW0ARVHXDBghXOe5H6RUUGe7GOOsQjl7n84ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707420477; 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=WscErq0bCIm2/PGCCNg2Vemi91rvBgZaO3iCO24vmWU=; b=lhss+S7F/9HESQciYnbe1lbq9fPtqO/IorGWjYILynr8bvs5tGIYyF7JkDIEks/PbRnq99 l+3CU062VZGO+MkFkBL0X2aKr9289SzuZU7QCcHyN9FLtDzwwgEXTkKk3USBRyEX9Xb0Yh LklMx218aI8yKofT9pDXRX1rvoSDkCN2BgL+h3ZGP1IpdQ3s5lL3zzBBv2cCbEnNiGE00R ib4QTHByMN6pAuVTYuk+QApq2Vh47quYGl3uJX360/M3QVyW+jCPs1OcFX6urHOWwDog6B +B4OI89KA+6oEK5wLDsp3aOsVtBqhNFyDB410HhdVLDE1/kSgzvAjqwB5hBr4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707420477; a=rsa-sha256; cv=none; b=vM9QOn04etuvphLquH2HVTyeBx6PuReqKkk5APx9aiqTNvyXXU71hW9XUzTmwjQc9X3eF2 DpMhWIJNBUh22x/TVCtGpvIBbDfv3GHuwyd3/zo9eKWN0Wb3kZJFys049Wbr92ME4EK3yC H6mytNLSdNRugeeHh+IlPHXBIMXC5jCb1+DAv+EQg6THvH20ZlI+A4tpRcCjN2X3cSuOdE f4L21AFS9fJbAoJwH0xybTJdP9D+OrONZJNXe4XuXsHUpybzxyoEUfkouOtSNtKxUDdows Y9jAY4u5S64z/GS0rEf9UafJW1Fp6wrj/YPQ40ss/XH93/A/5AKFdlDU+OMaNA== 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 4TW6T91YWdz134V; Thu, 8 Feb 2024 19:27:57 +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 418JRvoe009443; Thu, 8 Feb 2024 19:27:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 418JRvpT009440; Thu, 8 Feb 2024 19:27:57 GMT (envelope-from git) Date: Thu, 8 Feb 2024 19:27:57 GMT Message-Id: <202402081927.418JRvpT009440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: d5d6b3938d84 - stable/13 - Merge commit 4a39d0890894 from llvm-project (by Mark Johnston): 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: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d5d6b3938d842529a01bdc6404c77e84213b0192 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d5d6b3938d842529a01bdc6404c77e84213b0192 commit d5d6b3938d842529a01bdc6404c77e84213b0192 Author: Dimitry Andric AuthorDate: 2024-01-29 17:26:48 +0000 Commit: Dimitry Andric CommitDate: 2024-02-08 19:27:38 +0000 Merge commit 4a39d0890894 from llvm-project (by Mark Johnston): [libc++] Fix filesystem::remove_all() on FreeBSD (#79540) remove_all_impl() opens the target path with O_NOFOLLOW, which fails if the target is a symbolic link. On FreeBSD, rather than returning ELOOP, openat() returns EMLINK. This is unlikely to change for compatibility reasons, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214633 . Thus, check for EMLINK as well. Reported by: markj PR: 276632 MFC after: 3 days (cherry picked from commit ee14a9725d73150e89367550206803fe36ae3089) --- contrib/llvm-project/libcxx/src/filesystem/operations.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/libcxx/src/filesystem/operations.cpp b/contrib/llvm-project/libcxx/src/filesystem/operations.cpp index 63a119aa983e..1877bcd79f4d 100644 --- a/contrib/llvm-project/libcxx/src/filesystem/operations.cpp +++ b/contrib/llvm-project/libcxx/src/filesystem/operations.cpp @@ -823,8 +823,9 @@ uintmax_t remove_all_impl(int parent_directory, const path& p, error_code& ec) { // If opening `p` failed because it wasn't a directory, remove it as // a normal file instead. Note that `openat()` can return either ENOTDIR - // or ELOOP depending on the exact reason of the failure. - if (ec == errc::not_a_directory || ec == errc::too_many_symbolic_link_levels) { + // or ELOOP depending on the exact reason of the failure. On FreeBSD it + // may return EMLINK instead of ELOOP, contradicting POSIX. + if (ec == errc::not_a_directory || ec == errc::too_many_symbolic_link_levels || ec == errc::too_many_links) { ec.clear(); if (::unlinkat(parent_directory, p.c_str(), /* flags = */0) == -1) { ec = detail::capture_errno();