<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Use the source, Luke.<div class=""><br class=""></div><div class=""><div class="">How "ls" does it:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/apple-oss-distributions/file_cmds/tree/file_cmds-321.100.11/ls" class="">https://github.com/apple-oss-distributions/file_cmds/tree/file_cmds-321.100.11/ls</a></div><div class=""><br class=""></div><div class="">Looks like the presence of an ACL and getting a handle for it is done in ls.c, and actually retrieving and printing all the entries (ls.c retrieves the 1st entry just to make sure it's really there) is done in print.c.</div><div class=""><br class=""></div><div class="">I gather that getattrlist(2) and setattrlist(2) are what, for the filesystems that support those calls (not all do!) underlie the various section 3 acl*() routines, but if in doubt, you could even look at the source for those library routines. But beware: acl(3) says:</div><div class="">     The syscalls between the internal interfaces and the public library routines may change over time, and as such are not documented.  They are not intended to be called directly without going through the library.</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Feb 5, 2022, at 22:29, raf <<a href="mailto:macports@raf.org" class="">macports@raf.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class="">Does anyone know how to get at macOS's ACLs from C?<br class="">I just need to access them in text form. I'm using<br class="">the "POSIX" ACL API, and it compiles and runs, but<br class="">it doesn't find anything. The ACL entries that I can<br class="">create with chmod +a, and view with ls -e, don't<br class="">show up because they're not "POSIX" ACL compatible<br class="">(or some similar sensible reason). Searching the net<br class="">has only turned up the "POSIX" ACL API so far.<br class=""><br class="">cheers,<br class="">raf<br class=""><br class=""></div></div></blockquote></div><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>-- <br class="">eMail:<span class="Apple-tab-span" style="white-space: pre;">                          </span><a href="mailto:rlhamil@smart.net" class="">mailto:rlhamil@smart.net</a></div><div><br class=""></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""></div></body></html>