[MacPorts] #65569: emacs and legacy-support: `openat` broken?

MacPorts noreply at macports.org
Fri Sep 1 02:18:54 UTC 2023


#65569: emacs and legacy-support: `openat` broken?
-------------------------+-------------------------------------------------
  Reporter:  lemzwerg    |      Owner:  drkp
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:  lion mountainlion snowleopard
      Port:  emacs       |  mavericks
  legacy-support         |
-------------------------+-------------------------------------------------

Comment (by acjones8):

 Alright! I've found the source of the bug, and I wrote a patch that fixes
 it. Emacs compiles and functions fine even on 10.5 PPC now, so this should
 restore compatibility with all newer versions of OS X as well.

 The problem is that Emacs passes in `AT_EACCESS` when it checks for the
 directories. That line above only leaves 0 if the flag is either set to 0
 itself, or if it equals `AT_SYMLINK_NOFOLLOW`. Because the flag isn't
 accepted, it errors out, and that makes Emacs think the argument is
 invalid, even though the path is perfectly fine and Emacs has permission
 to access it. If you insert this piece of code into `src/atcalls.c`,
 inside `faccessat()` on line 106:
 {{{
 // Ignore AT_EACCESS flag
 if (flags == AT_EACCESS)
 {
     flags = 0; // Zero out AT_EACCESS, use real user instead
 }
 }}}
 then it doesn't error out and Emacs compiles without any errors. In
 testing, it seems so far to function fine - I'm able to load up a C file,
 text syntax highlighting looks correct, and I can execute elisp code with
 no problems.

-- 
Ticket URL: <https://trac.macports.org/ticket/65569#comment:10>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list