1 .\" Access Control Lists manual pages
3 .\" (C) 2002 Andreas Gruenbacher, <a.gruenbacher@bestbits.at>
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual. If not, see
22 .\" <http://www.gnu.org/licenses/>.
29 .Nd set an ACL by filename
31 Linux Access Control Lists library (libacl, \-lacl).
36 .Fn acl_set_file "const char *path_p" "acl_type_t type" "acl_t acl"
40 function associates an access ACL with a file or directory, or
41 associates a default ACL with a directory. The pathname for the file or
42 directory is pointed to by the argument
45 The effective user ID of the process must match the owner of the file or
46 directory or the process must have the CAP_FOWNER capability for the
49 The value of the argument
51 is used to indicate whether the access ACL or the default ACL associated
56 parameter is ACL_TYPE_ACCESS, the access ACL of
60 parameter is ACL_TYPE_DEFAULT, the default ACL of
62 shall be set. If the argument
64 specifies a type of ACL that cannot be associated with
66 then the function fails.
70 parameter must reference a valid ACL according to the rules described on the
74 parameter is ACL_TYPE_ACCESS, and must either reference a valid ACL or an ACL with zero ACL entries if the
76 parameter is ACL_TYPE_DEFAULT. If the
78 parameter references an empty ACL, then the
80 function removes any default ACL associated with the directory referred to
87 If any of the following conditions occur, the
93 to the corresponding value:
96 Search permission is denied for a component of the path prefix or the
97 object exists and the process does not have appropriate access rights.
101 specifies a type of ACL that cannot be associated with
106 does not point to a valid ACL.
108 The ACL has more entries than the file referred to by
114 parameter is not ACL_TYPE_ACCESS or ACL_TYPE_DEFAULT.
118 parameter is ACL_TYPE_DEFAULT, but the file referred to by
121 .It Bq Er ENAMETOOLONG
122 The length of the argument
126 The named object does not exist or the argument
128 points to an empty string.
130 The directory or file system that would contain the new ACL cannot be extended or the file system is out of file allocation resources.
132 A component of the path prefix is not a directory.
134 The file identified by
136 cannot be associated with the ACL because the file system on which the file
137 is located does not support this.
139 The process does not have appropriate privilege to perform the operation to set the ACL.
141 This function requires modification of a file system which is currently read-only.
144 IEEE Std 1003.1e draft 17 (\(lqPOSIX.1e\(rq, abandoned)
150 parameter refers to an empty ACL and the
152 parameter is ACL_TYPE_DEFAULT is an extension in the Linux implementation, in order that all values returned by
156 The POSIX.1e function for removing a default ACL is
157 .Fn acl_delete_def_file .
159 .Xr acl_delete_def_file 3 ,
165 Derived from the FreeBSD manual pages written by
166 .An "Robert N M Watson" Aq rwatson@FreeBSD.org ,
167 and adapted for Linux by
168 .An "Andreas Gruenbacher" Aq a.gruenbacher@bestbits.at .