diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5c4dcb39f..92487824e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -67,6 +67,7 @@ Scripting improvements - Some error messages occuring after fork, like "text file busy" have been replaced by bespoke error messages for fish. This also restores error messages with current glibc versions that removed sys_errlist (:issue:`8234`, :issue:`4183`). - The ``realpath`` builtin now also squashes leading slashes with the ``--no-symlinks`` option (:issue:`8281`). - When trying to ``cd`` to a dangling (broken) symbolic link, fish will print an error noting that the target is a broken link (:issue:`8264`). +- On MacOS terminals that are not granted permissions to access a folder, ``cd`` would print a spurious "rotten symlink" error, which has been corrected to "permission denied" (:issue:`8264`). Interactive improvements ------------------------ diff --git a/src/builtin_cd.cpp b/src/builtin_cd.cpp index 9846d8dfd..03cfd9bc0 100644 --- a/src/builtin_cd.cpp +++ b/src/builtin_cd.cpp @@ -117,7 +117,7 @@ maybe_t builtin_cd(parser_t &parser, io_streams_t &streams, const wchar_t * } else if (best_errno == ENOENT) { streams.err.append_format(_(L"%ls: The directory '%ls' does not exist\n"), cmd, dir_in.c_str()); - } else if (best_errno == EACCES) { + } else if (best_errno == EACCES || best_errno == EPERM) { streams.err.append_format(_(L"%ls: Permission denied: '%ls'\n"), cmd, dir_in.c_str()); } else { errno = best_errno;