README.acls 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. $FreeBSD$
  2. UFS Access Control Lists Copyright
  3. The UFS Access Control Lists implementation is copyright Robert Watson,
  4. and is made available under a Berkeley-style license.
  5. About UFS Access Control Lists (ACLs)
  6. Access control lists allow the association of fine-grained discretionary
  7. access control information with files and directories, extending the
  8. base UNIX permission model in a (mostly) compatible way. This
  9. implementation largely follows the POSIX.1e model, and relies on the
  10. availability of extended attributes to store extended components of
  11. the ACL, while maintaining the base permission information in the inode.
  12. Using UFS Access Control Lists (ACLs)
  13. Support for UFS access control lists may be enabled by adding:
  14. options UFS_ACL
  15. to your kernel configuration. As ACLs rely on the availability of extended
  16. attributes, your file systems must have support for extended attributes.
  17. For UFS2, this is supported natively, so no further configuration is
  18. necessary. For UFS1, you must also enable the optional extended attributes
  19. support documented in README.extattr. A summary of the instructions
  20. and ACL-specific information follows.
  21. To enable support for ACLs on a file system, the 'acls' mount flag
  22. must be set for the file system. This may be set using the tunefs
  23. '-a' flag:
  24. tunefs -a enable /dev/md0a
  25. Or by using the mount-time flag:
  26. mount -o acls /dev/md0a /mnt
  27. The flag may also be set in /etc/fstab. Note that mounting a file
  28. system previously configured for ACLs without ACL-support will result
  29. in incorrect application of discretionary protections. Likewise,
  30. mounting an ACL-enabled file system without kernel support for ACLs
  31. will result in incorrect application of discretionary protections. If
  32. the kernel is not configured for ACL support, a warning will be
  33. printed by the kernel at mount-time. For reliability purposes, it
  34. is recommended that the superblock flag be used instead of the
  35. mount-time flag, as this will avoid re-mount isses with the root file
  36. system. For reliability and performance reasons, the use of ACLs on
  37. UFS1 is discouraged; UFS2 extended attributes provide a more reliable
  38. storage mechanism for ACLs.
  39. Currently, support for ACLs on UFS1 requires the use of UFS1 EAs, which may
  40. be enabled by adding:
  41. options UFS_EXTATTR
  42. to your kernel configuration file and rebuilding. Because of filesystem
  43. mount atomicity requirements, it is also recommended that:
  44. options UFS_EXTATTR_AUTOSTART
  45. be added to the kernel so as to support the atomic enabling of the
  46. required extended attributes with the filesystem mount operation. To
  47. enable ACLs, two extended attributes must be available in the
  48. EXTATTR_NAMESPACE_SYSTEM namespace: "posix1e.acl_access", which holds
  49. the access ACL, and "posix1e.acl_default" which holds the default ACL
  50. for directories. If you're using UFS1 Extended Attributes, the following
  51. commands may be used to create the necessary EA backing files for
  52. ACLs in the filesystem root of each filesystem. In these examples,
  53. the root filesystem is used; see README.extattr for more details.
  54. mkdir -p /.attribute/system
  55. cd /.attribute/system
  56. extattrctl initattr -p / 388 posix1e.acl_access
  57. extattrctl initattr -p / 388 posix1e.acl_default
  58. On the next mount of the root filesystem, the attributes will be
  59. automatically started, and ACLs will be enabled.