]> code.delx.au - gnu-emacs/blobdiff - lib/acl-internal.c
* lisp/simple.el (undo-amalgamate-change-group): New function
[gnu-emacs] / lib / acl-internal.c
index d9bd4461ea672c929adb786c061dea1502853745..4de60c30ec11194c076dab5aed400854bc8dd02a 100644 (file)
@@ -1,6 +1,6 @@
-/* Test whether a file has a nontrivial access control list.
+/* Test whether a file has a nontrivial ACL.  -*- coding: utf-8 -*-
 
-   Copyright (C) 2002-2003, 2005-2015 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -115,6 +115,13 @@ acl_access_nontrivial (acl_t acl)
 #  endif
 }
 
+int
+acl_default_nontrivial (acl_t acl)
+{
+  /* acl is non-trivial if it is non-empty.  */
+  return (acl_entries (acl) > 0);
+}
+
 # endif
 
 #elif USE_ACL && HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */
@@ -467,3 +474,34 @@ acl_nontrivial (int count, struct acl *entries)
 }
 
 #endif
+
+void
+free_permission_context (struct permission_context *ctx)
+{
+#if USE_ACL
+# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */
+  if (ctx->acl)
+    acl_free (ctx->acl);
+#  if !HAVE_ACL_TYPE_EXTENDED
+  if (ctx->default_acl)
+    acl_free (ctx->default_acl);
+#  endif
+
+# elif defined GETACL /* Solaris, Cygwin */
+  free (ctx->entries);
+#  ifdef ACE_GETACL
+  free (ctx->ace_entries);
+#  endif
+
+# elif HAVE_GETACL /* HP-UX */
+
+#  if HAVE_ACLV_H
+#  endif
+
+# elif HAVE_STATACL /* older AIX */
+
+# elif HAVE_ACLSORT /* NonStop Kernel */
+
+# endif
+#endif
+}