all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#17810: 24.3.91; file-acl does not return ACL on Mac OS X
@ 2014-06-19 10:39 YAMAMOTO Mitsuharu
  2014-06-20  6:35 ` Paul Eggert
  0 siblings, 1 reply; 4+ messages in thread
From: YAMAMOTO Mitsuharu @ 2014-06-19 10:39 UTC (permalink / raw)
  To: 17810

On Mac OS X >= 10.5, the directory ~/Desktop has ACL, but (file-acl
"~/Desktop") returns nil.

  $ ls -lde ~/Desktop
  drwx------+ 4 mituharu  staff  136  6 11 12:04 /Users/mituharu/Desktop
   0: group:everyone deny delete

A comment in lib/qcopy-acl.c and lib/qset-acl.c says:

  # if !HAVE_ACL_TYPE_EXTENDED
    /* Linux, FreeBSD, IRIX, Tru64 */
...
  # else /* HAVE_ACL_TYPE_EXTENDED */
    /* Mac OS X */

    /* On Mac OS X,  acl_get_file (name, ACL_TYPE_ACCESS)
       and           acl_get_file (name, ACL_TYPE_DEFAULT)
       always return NULL / EINVAL.  You have to use
		     acl_get_file (name, ACL_TYPE_EXTENDED)
       or            acl_get_fd (open (name, ...))
       to retrieve an ACL.
       On the other hand,
		     acl_set_file (name, ACL_TYPE_ACCESS, acl)
       and           acl_set_file (name, ACL_TYPE_DEFAULT, acl)
       have the same effect as
		     acl_set_file (name, ACL_TYPE_EXTENDED, acl):
       Each of these calls sets the file's ACL.  */

So, the following lines in src/fileio.c seems to always result in
returning Qnil.

  acl = acl_get_file (SSDATA (absname), ACL_TYPE_ACCESS);
  if (acl == NULL)
    return Qnil;

If I change the above ACL_TYPE_ACCESS to ACL_TYPE_EXTENDED as an
experiment, then I get the following string as a result of (file-acl
"~/Desktop"):

  "!#acl 1
  group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF0000000C:everyone:12:deny:delete
  "

And I could pass it to set-file-acl to set ACL of another file.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-21  7:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-19 10:39 bug#17810: 24.3.91; file-acl does not return ACL on Mac OS X YAMAMOTO Mitsuharu
2014-06-20  6:35 ` Paul Eggert
2014-06-21  3:48   ` YAMAMOTO Mitsuharu
2014-06-21  7:04     ` Paul Eggert

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.