Git init
[framework/base/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
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 .Sh DESCRIPTION
38 The
39 .Fn acl_extended_file
40 function returns
41 .Li 1
42 if the file or directory referred to by the argument
43 .Va path_p
44 is associated with an extended access ACL, or if the directory referred to by
45 .Va path_p
46 is associated with a default ACL. The function returns
47 .Li 0
48 if the file has neither an extended access ACL nor a default ACL.
49 .Pp
50 An extended ACL is an ACL that contains entries other than the three
51 required entries of tag types ACL_USER_OBJ, ACL_GROUP_OBJ and ACL_OTHER.
52 If the result of the
53 .Fn acl_extended_file
54 function for a file object is
55 .Li 0 ,
56 then ACLs define no discretionary access rights other than those
57 already defined by the traditional file permission bits.
58 .Pp
59 Access to the file object may be further restricted by other
60 mechanisms, such as Mandatory Access Control schemes. The
61 .Xr access 2
62 system call can be used to check whether a given type of access to a file
63 object would be granted.
64 .Sh RETURN VALUE
65 If successful, the
66 .Fn acl_extended_file
67 function returns
68 .Li 1
69 if the file object referred to by
70 .Va path_p
71 has an extended access ACL or a default ACL, and
72 .Li 0
73 if the file object referred to by
74 .Va path_p
75 has neither an extended access ACL nor a default ACL. Otherwise, the value
76 .Li -1
77 is returned and the global variable
78 .Va errno
79 is set to indicate the error.
80 .Sh ERRORS
81 If any of the following conditions occur, the
82 .Fn acl_extended_file
83 function returns
84 .Li -1
85 and sets
86 .Va errno
87 to the corresponding value:
88 .Bl -tag -width Er
89 .It Bq Er EACCES
90 Search permission is denied for a component of the path prefix.
91 .It Bq Er ENAMETOOLONG
92 The length of the argument
93 .Va path_p
94 is too long.
95 .It Bq Er ENOENT
96 The named object does not exist or the argument
97 .Va path_p
98 points to an empty string.
99 .It Bq Er ENOTDIR
100 A component of the path prefix is not a directory.
101 .It Bq Er ENOTSUP
102 The file system on which the file identified by
103 .Va path_p
104 is located does not support ACLs, or ACLs are disabled.
105 .El
106 .Sh STANDARDS
107 This is a non-portable, Linux specific extension to the ACL manipulation
108 functions defined in IEEE Std 1003.1e draft 17 (\(lqPOSIX.1e\(rq, abandoned).
109 .Sh SEE ALSO
110 .Xr access 2 ,
111 .Xr acl_get_file 3 ,
112 .Xr acl 5
113 .Sh AUTHOR
114 Written by
115 .An "Andreas Gruenbacher" Aq a.gruenbacher@bestbits.at .