+}
+
+bool parse_acl_stream(JCR *jcr, int stream)
+{
+ /*
+ * Based on the stream being passed in dispatch to the right function
+ * for parsing and restoring a specific acl. The platform determines
+ * which streams are recognized and parsed and which are handled by
+ * the default case and ignored. The old STREAM_UNIX_ACCESS_ACL and
+ * STREAM_UNIX_DEFAULT_ACL is handled as a legacy stream by each function.
+ * As only one of the platform defines is true per compile we never end
+ * up with duplicate switch values.
+ */
+ switch (stream) {
+#if defined(HAVE_AIX_OS)
+ case STREAM_UNIX_ACCESS_ACL:
+ case STREAM_UNIX_DEFAULT_ACL:
+ case STREAM_ACL_AIX_TEXT:
+ return aix_parse_acl_stream(jcr, stream);
+#elif defined(HAVE_DARWIN_OS)
+ case STREAM_UNIX_ACCESS_ACL:
+ case STREAM_ACL_DARWIN_ACCESS_ACL:
+ return darwin_parse_acl_stream(jcr, stream);
+#elif defined(HAVE_FREEBSD_OS)
+ case STREAM_UNIX_ACCESS_ACL:
+ case STREAM_UNIX_DEFAULT_ACL:
+ case STREAM_ACL_FREEBSD_DEFAULT_ACL:
+ case STREAM_ACL_FREEBSD_ACCESS_ACL:
+ return freebsd_parse_acl_stream(jcr, stream);
+#elif defined(HAVE_HPUX_OS)
+ case STREAM_UNIX_ACCESS_ACL:
+ case STREAM_ACL_HPUX_ACL_ENTRY:
+ return hpux_parse_acl_stream(jcr, stream);
+#elif defined(HAVE_IRIX_OS)
+ case STREAM_UNIX_ACCESS_ACL:
+ case STREAM_UNIX_DEFAULT_ACL:
+ case STREAM_ACL_IRIX_DEFAULT_ACL:
+ case STREAM_ACL_IRIX_ACCESS_ACL:
+ return irix_parse_acl_stream(jcr, stream);
+#elif defined(HAVE_LINUX_OS)
+ case STREAM_UNIX_ACCESS_ACL:
+ case STREAM_UNIX_DEFAULT_ACL:
+ case STREAM_ACL_LINUX_DEFAULT_ACL:
+ case STREAM_ACL_LINUX_ACCESS_ACL:
+ return linux_parse_acl_stream(jcr, stream);
+#elif defined(HAVE_OSF1_OS)
+ case STREAM_UNIX_ACCESS_ACL:
+ case STREAM_UNIX_DEFAULT_ACL:
+ case STREAM_ACL_TRU64_DEFAULT_ACL:
+ case STREAM_ACL_TRU64_ACCESS_ACL:
+ case STREAM_ACL_TRU64_DEFAULT_DIR_ACL:
+ return tru64_parse_acl_stream(jcr, stream);
+#elif defined(HAVE_SUN_OS)
+ case STREAM_UNIX_ACCESS_ACL:
+ case STREAM_ACL_SOLARIS_ACLENT:
+#if defined(HAVE_EXTENDED_ACL)
+ case STREAM_ACL_SOLARIS_ACE:
+#endif
+ return solaris_parse_acl_stream(jcr, stream);
+#endif
+ default:
+ /*
+ * Issue a warning and discard the message. But pretend the restore was ok.
+ */
+ Qmsg2(jcr, M_WARNING, 0,
+ _("Can't restore ACLs of %s - incompatible acl stream encountered - %d\n"),
+ jcr->last_fname, stream);
+ return true;
+ } /* end switch (stream) */
+}