Has anyone looked into adding support for ZFS ACLs into Rsync? It would be really convenient if it would support transparent conversions from old-style Posix ACLs to ZFS ACLs on the fly.... One way Posix->ZFS is probably good enough. I''ve tried Googling, but haven''t come up with much. There seems to be some kind of built-in conversion function for just that in the CVS archive for Opensolaris (http://cvs.opensolaris.org/source/raw/on/usr/src/lib/libsec/common/aclutils.c, function onvert_aent_to_ace), but is there some public interface one could use? This message posted from opensolaris.org
Peter Eriksson wrote:> Has anyone looked into adding support for ZFS ACLs into Rsync? It would be really convenient if it would support transparent conversions from old-style Posix ACLs to ZFS ACLs on the fly.... > > One way Posix->ZFS is probably good enough. I''ve tried Googling, but haven''t come up with much. There seems to be some kind of built-in conversion function for just that in the CVS archive for Opensolaris (http://cvs.opensolaris.org/source/raw/on/usr/src/lib/libsec/common/aclutils.c, function onvert_aent_to_ace), but is there some public interface one could use? >It should be pretty simple to do. We have acl_get()/acl_set() which are public interfaces. The acl_set() function will attempt to translate the ACL when necessary prior to setting it. Translation from POSIX->ZFS will always work. Here is an example from compress.c on how to retrieve/set an ACL with acl_get()/acl_set(). http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/compress/compress.c#1658 Or take a look at how ufsrestore does it. It first has to build an acl_t structure and then sets the ACL via acl_set(). http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/backup/restore/tape.c#1324 -Mark