Specification of enhancing Areca backup to support filesystem ACL and extended attributes 1. Overview For a backup tool, it should be able to record/restore ALL the data with ALL the permissions. If extended attribtues are not able to be included then that is not ALL the data, if ACLs are not included then that is not ALL the permissions. 2. Requirement Specification R-1: Backup ACL, including ZFS ACL if it has. R-2: Backup extended attributes, including ZFS extended attributes if it has. 3. High Level Design 3.1 Issues The existing Areca backup tool was developed by Java, it is using Java IO API to copy files from source to destination. Current architecture can recognize what platform is (Windows, Unix); and if it is Unix system, the Areca will just restore owner, group and basic permissions by running Unix command 'chown' and 'chmod'. It does not record any ACL and extended attribute information. 3.2 Possible Solution 3.2.1 Using existing tools On Solaris, user can use getfacl(1)/setfacl(1) to record ACL permissions; However, user has to use openat() programming API to interoperate with file system, see fsattr(5). Solaris has cpio(1), tar(1) and pax(1) archive tools; they all support ACL and extended attributes. User can use one of these 3 tools to backup data. On Linux, GNU cpio, tar and pax are also available. However, GNU pax is not officially released. Advantage: Less code change. Disadvantage: Lower performance, platform restriction (sort of hard-code). 3.2.2 Using programming API Java Native Interface can let Java Code to call C programming interface. On Solaris, the cpio.h(3HEAD) is available and stable; on Linux the corresponding header file is also available. Using JNI to record/restore IO in stead of using Java IO on Unix (Solaris/Linux) can resolve the issue permanently. Advantage: Higher performance, independent of system tools/packages Disadvantage: More code change. 3.3 Design Specification Due to the analyzing above, I would like to chose 3.2.2 as the total solution for this backup tool. There are areas which need to be enhanced to support R-1 and R-2. 3.1 Can distinguish Solaris, Linux and Windows Areca will use different IO APIs for these different platforms. Areca needs to make sure R-1 and R-2 can be recorded on Solaris. 3.2 JNI programming code for Solaris cpio.h Using Java Native Interface to include cpio.h to support ACL and extended attribute backup. 4. Design Limitation It is hard to sync ACL, extend attributes definition among Windows, Linux and Solaris. It is even harder to sync them between FreeBSD and other Unix platform. This phase only support OpenSolaris. If there are requirements for any other system, like Linux, windowsNT, MacOS, using JNI to swith IO API should be applicable.