summaryrefslogtreecommitdiff
path: root/lib/acl-internal.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-05-27 17:46:15 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-05-27 17:55:06 -0700
commit6c52e9b93b68795d1876718d8f3c1d57bf7f6d91 (patch)
treeb2d93b1121c05cfffa59df9325139cdf56eed6c0 /lib/acl-internal.c
parentcc41938ae0f5694d657f360f19dd9ac166271db2 (diff)
downloademacs-6c52e9b93b68795d1876718d8f3c1d57bf7f6d91.tar.gz
Merge from gnulib
This incorporates: 2015-05-27 qacl: Reimplement qset_acl and qcopy_acl (Bug#20666) 2015-05-27 file-has-acl: Split feature tests again (Bug#20667) 2015-05-27 string: fix build failure on BSD/OSX with FORTIFY_SOURCE 2015-05-26 stdio: limit __gnu_printf__ witness to gcc 4.4+ 2015-05-26 inttypes: force correct mingw PRIdMAX even without <stdio.h> 2015-05-26 stdio: fix probe on mingw under gcc 5.1 * admin/merge-gnulib (GNULIB_MODULES): Replace qacl with qcopy-acl, since we don't need the rest of qacl. * doc/misc/texinfo.tex, lib/acl-internal.c, lib/acl-internal.h: * lib/inttypes.in.h, lib/qcopy-acl.c, lib/qset-acl.c: * lib/string.in.h, m4/acl.m4, m4/stdio_h.m4: Get latest versions from gnulib. * lib/get-permissions.c, lib/set-permissions.c: New files. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * nt/gnulib.mk: Merge lib/gnulib.mk changes by hand.
Diffstat (limited to 'lib/acl-internal.c')
-rw-r--r--lib/acl-internal.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/acl-internal.c b/lib/acl-internal.c
index d9bd4461ea6..1a2f8c44bf7 100644
--- a/lib/acl-internal.c
+++ b/lib/acl-internal.c
@@ -467,3 +467,34 @@ acl_nontrivial (int count, struct acl *entries)
}
#endif
+
+void
+free_permission_context (struct permission_context *ctx)
+{
+#ifdef 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
+}