Name Date Size #Lines LOC

..08-May-2022-

README.aclsH A D17-Aug-20233.3 KiB7958

README.extattrH A D17-Aug-20234.4 KiB9174

acl.hH A D17-Aug-20232.1 KiB5615

dinode.hH A D12-Jan-20249 KiB21499

dir.hH A D27-Nov-20235.7 KiB15459

dirhash.hH A D17-Aug-20235.2 KiB13348

extattr.hH A D17-Aug-20235.4 KiB14779

gjournal.hH A D17-Aug-20231.6 KiB385

inode.hH A D12-Jan-202411.1 KiB316192

quota.hH A D27-Nov-20239.3 KiB259141

ufs_acl.cH A D17-Aug-202316.8 KiB681383

ufs_bmap.cH A D12-Jan-202413.7 KiB524349

ufs_dirhash.cH A D17-Aug-202336.4 KiB1,325826

ufs_extattr.cH A D17-Aug-202333.8 KiB1,299821

ufs_extern.hH A D27-Nov-20235.6 KiB13478

ufs_gjournal.cH A D17-Aug-20233.5 KiB13186

ufs_inode.cH A D27-Nov-20236.8 KiB257166

ufs_lookup.cH A D12-Jan-202442.8 KiB1,5691,015

ufs_quota.cH A D27-Nov-202343.9 KiB1,8741,353

ufs_vfsops.cH A D27-Nov-20234.6 KiB199126

ufs_vnops.cH A D12-Jan-202476.1 KiB3,0682,260

ufsmount.hH A D27-Nov-20237.5 KiB197114

README.acls

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

README.extattr

1
2  UFS Extended Attributes Copyright
3
4The UFS Extended Attributes implementation is copyright Robert Watson, and
5is made available under a Berkeley-style license.
6
7  About UFS Extended Attributes
8
9Extended attributes allow the association of additional arbitrary
10meta-data with files and directories.  Extended attributes are defined in
11the form name=value, where name is an nul-terminated string in the style
12of a filename, and value is a binary blob of zero or more bytes. The UFS
13extended attribute service layers support for extended attributes onto a
14backing file, in the style of the quota implementation, meaning that it
15requires no underlying format changes in the filesystem.  This design
16choice exchanges simplicity, usability and easy deployment for
17performance.  When defined, extended attribute names exist in a series of
18disjoint namespaces: currently, two namespaces are defined:
19EXTATTR_NAMESPACE_SYSTEM and EXTATTR_NAMESPACE_USER.  The primary
20distinction lies in the protection model: USER EAs are protected using the
21normal inode protections, whereas SYSTEM EAs require privilege to access
22or modify.
23
24  Using UFS Extended Attributes
25
26Support for UFS extended attributes is natively available in UFS2, and
27requires no special configuration.  For reliability, administrative,
28and performance reasons, if you plan to use extended attributes, it
29is recommended that you use UFS2 in preference to UFS1.
30
31Support for UFS extended attributes may be enabled for UFS1 by adding:
32
33	options UFS_EXTATTR
34
35to your kernel configuration file.  This allows UFS-based filesystems to
36support extended attributes, but requires manual administration of EAs
37using the extattrctl tool, including the starting of EA support for each
38filesystem, and the enabling of individual attributes for the file
39system.  The extattrctl utility may be used to initialize backing files
40before first use, to start and stop EA service on a filesystem, and to
41enable and disable named attributes.  The command lines for extattrctl
42take the following forms:
43
44  extattrctl start [path]
45  extattrctl stop [path]
46  extattrctl initattr [-f] [-p path] [attrsize] [attrfile]
47  extattrctl enable [path] [attrnamespace] [attrname] [attrfile]
48  extattrctl disable [path] [attrnamespace] [attrname]
49
50In each case, [path] is used to indicate the mounted filesystem on which
51to perform the operation.  [attrnamespace] refers to the namespace in
52which the attribute is being manipulated, and may be "system" or "user".
53The [attrname] is the attribute name to use for the operation. The
54[attrfile] argument specifies the attribute backing file to use. When
55using the "initattr" function to initialize a backing file, the maximum
56size of attribute data must be defined in bytes using the [attrsize]
57field.  Optionally, the [-p path] argument may be used to indicate to
58extattrctl that it should pre-allocate space for EA data, rather than
59creating a sparse backing file.  This prevents attribute operations from
60failing in low disk-space conditions (which can be important when EAs are
61used for security purposes), but pre-allocation will consume space
62proportional to the product of the defined maximum attribute size and
63number of attributes on the specified filesystem.
64
65Manual configuration increases administrative overhead, but also
66introduces the possibility of race conditions during filesystem mount, if
67EAs are used to support other features, as starting the EAs manually is
68not atomic with the mount operation.  To address this problem, an
69additional kernel option may be defined to auto-start EAs on a UFS file
70system based on special directories at mount-time:
71
72	options UFS_EXTATTR_AUTOSTART
73
74If this option is defined, UFS will search for a ".attribute"
75sub-directory of the filesystem root during the mount operation.  If it
76is found, EA support will be started for the filesystem.  UFS will then
77search for "system" and "user" sub-directories of the ".attribute"
78directory for any potential backing files, and enable an EA for each valid
79backing file with the name of the backing file as the attribute name.
80For example, by creating the following tree, the two EAs,
81posix1e.acl_access and posix1e.acl_default will be enabled in the system
82namespace of the root filesystem, reserving space for attribute data:
83
84  mkdir -p /.attribute/system
85  cd /.attribute/system
86  extattrctl initattr -p / 388 posix1e.acl_access
87  extattrctl initattr -p / 388 posix1e.acl_default
88
89On the next mount of the root filesystem, the attributes will be
90automatically started.
91