resetting manifest requested domain to floor
[platform/upstream/acl.git] / man / man3 / acl_extended_file.3
1 .\" Access Control Lists manual pages
2 .\"
3 .\" (C) 2002 Andreas Gruenbacher, <a.gruenbacher@bestbits.at>
4 .\"
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.
9 .\"
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.
14 .\"
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.
19 .\"
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/>.
23 .\"
24 .Dd March 23, 2002
25 .Dt ACL_EXTENDED_FILE 3
26 .Os "Linux ACL"
27 .Sh NAME
28 .Nm acl_extended_file, acl_extended_file_nofollow
29 .Nd test for information in ACLs by file name
30 .Sh LIBRARY
31 Linux Access Control Lists library (libacl, \-lacl).
32 .Sh SYNOPSIS
33 .In sys/types.h
34 .In acl/libacl.h
35 .Ft int
36 .Fn acl_extended_file "const char *path_p"
37 .Ft int
38 .Fn acl_extended_file_nofollow "const char *path_p"
39 .Sh DESCRIPTION
40 The
41 .Fn acl_extended_file
42 function returns
43 .Li 1
44 if the file or directory referred to by the argument
45 .Va path_p
46 is associated with an extended access ACL, or if the directory referred to by
47 .Va path_p
48 is associated with a default ACL. The function returns
49 .Li 0
50 if the file has neither an extended access ACL nor a default ACL.
51 .Pp
52 An extended ACL is an ACL that contains entries other than the three
53 required entries of tag types ACL_USER_OBJ, ACL_GROUP_OBJ and ACL_OTHER.
54 If the result of the
55 .Fn acl_extended_file
56 function for a file object is
57 .Li 0 ,
58 then ACLs define no discretionary access rights other than those
59 already defined by the traditional file permission bits.
60 .Pp
61 Access to the file object may be further restricted by other
62 mechanisms, such as Mandatory Access Control schemes. The
63 .Xr access 2
64 system call can be used to check whether a given type of access to a file
65 object would be granted.
66 .Pp
67 .Fn acl_extended_file_nofollow
68 is identical to
69 .Fn acl_extended_file ,
70 except in the case of a symbolic link, where the link itself is interrogated,
71 not the file that it refers to.  Since symbolic links have no ACL themselves,
72 the operation is supposed to fail on them.
73 .Sh RETURN VALUE
74 If successful, the
75 .Fn acl_extended_file
76 function returns
77 .Li 1
78 if the file object referred to by
79 .Va path_p
80 has an extended access ACL or a default ACL, and
81 .Li 0
82 if the file object referred to by
83 .Va path_p
84 has neither an extended access ACL nor a default ACL. Otherwise, the value
85 .Li -1
86 is returned and the global variable
87 .Va errno
88 is set to indicate the error.
89 .Sh ERRORS
90 If any of the following conditions occur, the
91 .Fn acl_extended_file
92 function returns
93 .Li -1
94 and sets
95 .Va errno
96 to the corresponding value:
97 .Bl -tag -width Er
98 .It Bq Er EACCES
99 Search permission is denied for a component of the path prefix.
100 .It Bq Er ENAMETOOLONG
101 The length of the argument
102 .Va path_p
103 is too long.
104 .It Bq Er ENOENT
105 The named object does not exist or the argument
106 .Va path_p
107 points to an empty string.
108 .It Bq Er ENOTDIR
109 A component of the path prefix is not a directory.
110 .It Bq Er ENOTSUP
111 The file system on which the file identified by
112 .Va path_p
113 is located does not support ACLs, or ACLs are disabled.
114 .El
115 .Sh STANDARDS
116 This is a non-portable, Linux specific extension to the ACL manipulation
117 functions defined in IEEE Std 1003.1e draft 17 (\(lqPOSIX.1e\(rq, abandoned).
118 .Sh SEE ALSO
119 .Xr access 2 ,
120 .Xr acl_get_file 3 ,
121 .Xr acl 5
122 .Sh AUTHOR
123 Written by
124 .An "Andreas Gruenbacher" Aq a.gruenbacher@bestbits.at .