summaryrefslogtreecommitdiff
path: root/lib/acl-internal.c
diff options
context:
space:
mode:
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
+}