Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jan 2024 02:22:11 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 276632] LLVM std::filesystem::remove_all fails to handle dangling symlinks
Message-ID:  <bug-276632-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276632

            Bug ID: 276632
           Summary: LLVM std::filesystem::remove_all fails to handle
                    dangling symlinks
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: markj@FreeBSD.org

remove_all_impl() will attempt to remove a file specified by its path,
recursing if it encounters a directory.

It opens the file with O_CLOEXEC | O_RDONLY | O_DIRECTORY | O_NOFOLLOW, whi=
ch
for a dangling symlink returns EMLINK on FreeBSD, contradicting POSIX (which
says it should return ELOOP in this scenario).  Bug 214633 notes this probl=
em,
but fixing it would break compatibility.

remove_all_impl() however only handles ENOTDIR and ELOOP, so it incorrectly
returns an error in this situation on FreeBSD.  We should extend it to check
for EMLINK as well.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-276632-227>