1*d81d5b2fSGleb Popov.\"- 2*d81d5b2fSGleb Popov.\" Copyright (c) 2021 Gleb Popov 3*d81d5b2fSGleb Popov.\" All rights reserved. 4*d81d5b2fSGleb Popov.\" 5*d81d5b2fSGleb Popov.\" Redistribution and use in source and binary forms, with or without 6*d81d5b2fSGleb Popov.\" modification, are permitted provided that the following conditions 7*d81d5b2fSGleb Popov.\" are met: 8*d81d5b2fSGleb Popov.\" 1. Redistributions of source code must retain the above copyright 9*d81d5b2fSGleb Popov.\" notice, this list of conditions and the following disclaimer. 10*d81d5b2fSGleb Popov.\" 2. Redistributions in binary form must reproduce the above copyright 11*d81d5b2fSGleb Popov.\" notice, this list of conditions and the following disclaimer in the 12*d81d5b2fSGleb Popov.\" documentation and/or other materials provided with the distribution. 13*d81d5b2fSGleb Popov.\" 14*d81d5b2fSGleb Popov.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15*d81d5b2fSGleb Popov.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16*d81d5b2fSGleb Popov.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17*d81d5b2fSGleb Popov.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18*d81d5b2fSGleb Popov.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19*d81d5b2fSGleb Popov.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20*d81d5b2fSGleb Popov.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21*d81d5b2fSGleb Popov.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22*d81d5b2fSGleb Popov.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23*d81d5b2fSGleb Popov.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24*d81d5b2fSGleb Popov.\" SUCH DAMAGE. 25*d81d5b2fSGleb Popov.\" 26*d81d5b2fSGleb Popov.Dd January 20, 2021 27*d81d5b2fSGleb Popov.Dt ACL_EQUIV_MODE_NP 3 28*d81d5b2fSGleb Popov.Os 29*d81d5b2fSGleb Popov.Sh NAME 30*d81d5b2fSGleb Popov.Nm acl_equiv_mode_np 31*d81d5b2fSGleb Popov.Nd check if ACL can be represented as UNIX permissions 32*d81d5b2fSGleb Popov.Sh LIBRARY 33*d81d5b2fSGleb Popov.Lb libc 34*d81d5b2fSGleb Popov.Sh SYNOPSIS 35*d81d5b2fSGleb Popov.In sys/types.h 36*d81d5b2fSGleb Popov.In sys/acl.h 37*d81d5b2fSGleb Popov.Ft int 38*d81d5b2fSGleb Popov.Fn acl_equiv_mode_np "acl_t acl" "mode_t* mode_p" 39*d81d5b2fSGleb Popov.Sh DESCRIPTION 40*d81d5b2fSGleb PopovThe 41*d81d5b2fSGleb Popov.Fn acl_equiv_mode_np 42*d81d5b2fSGleb Popovfunction is a non-portable call which checks that entries contained in the 43*d81d5b2fSGleb Popov.Va acl 44*d81d5b2fSGleb Popovargument use only the ACL_USER_OBJ, ACL_GROUP_OBJ, and ACL_OTHER tag types, and that 45*d81d5b2fSGleb Popovpermissions contained in these entries consist only of ACL_READ, ACL_WRITE and 46*d81d5b2fSGleb PopovACL_EXECUTE. 47*d81d5b2fSGleb PopovIf the check succeeds, the ACL can be represented as traditional UNIX 48*d81d5b2fSGleb Popovfile permissions bits set. 49*d81d5b2fSGleb Popov.Pp 50*d81d5b2fSGleb PopovIf 51*d81d5b2fSGleb Popov.Va mode_p 52*d81d5b2fSGleb Popovis not NULL and the check succeeds, the function fills the argument with a mode 53*d81d5b2fSGleb Popovvalue corresponding to permissions contained in the ACL. 54*d81d5b2fSGleb Popov.Sh RETURN VALUES 55*d81d5b2fSGleb PopovUpon successful completion, the function returns 0 if the ACL can be represented 56*d81d5b2fSGleb Popovas UNIX permissions and 1 if it is not possible. 57*d81d5b2fSGleb PopovOtherwise, a value 58*d81d5b2fSGleb Popovof 59*d81d5b2fSGleb Popov.Va -1 60*d81d5b2fSGleb Popovis returned, and 61*d81d5b2fSGleb Popov.Va errno 62*d81d5b2fSGleb Popovis set to indicate the error. 63*d81d5b2fSGleb Popov.Sh ERRORS 64*d81d5b2fSGleb PopovIf any of the following conditions occur, the 65*d81d5b2fSGleb Popov.Fn acl_equiv_mode_np 66*d81d5b2fSGleb Popovfunction returns a value of 67*d81d5b2fSGleb Popov.Va -1 68*d81d5b2fSGleb Popovand set 69*d81d5b2fSGleb Popov.Va errno 70*d81d5b2fSGleb Popovto the corresponding value: 71*d81d5b2fSGleb Popov.Bl -tag -width Er 72*d81d5b2fSGleb Popov.It Bq Er EINVAL 73*d81d5b2fSGleb PopovArgument 74*d81d5b2fSGleb Popov.Fa acl 75*d81d5b2fSGleb Popovdoes not point to a valid ACL. 76*d81d5b2fSGleb Popov.El 77*d81d5b2fSGleb Popov.Sh SEE ALSO 78*d81d5b2fSGleb Popov.Xr acl 3 , 79*d81d5b2fSGleb Popov.Xr acl_from_mode_np 3 , 80*d81d5b2fSGleb Popov.Xr posix1e 3 81*d81d5b2fSGleb Popov.Sh STANDARDS 82*d81d5b2fSGleb PopovPOSIX.1e is described in IEEE POSIX.1e draft 17. 83*d81d5b2fSGleb PopovDiscussion 84*d81d5b2fSGleb Popovof the draft continues on the cross-platform POSIX.1e implementation 85*d81d5b2fSGleb Popovmailing list. 86*d81d5b2fSGleb PopovTo join this list, see the 87*d81d5b2fSGleb Popov.Fx 88*d81d5b2fSGleb PopovPOSIX.1e implementation 89*d81d5b2fSGleb Popovpage for more information. 90*d81d5b2fSGleb Popov.Sh HISTORY 91*d81d5b2fSGleb PopovPOSIX.1e support was introduced in 92*d81d5b2fSGleb Popov.Fx 4.0 , 93*d81d5b2fSGleb Popovand development continues. 94*d81d5b2fSGleb Popov.Sh AUTHORS 95*d81d5b2fSGleb Popov.An Gleb Popov 96