Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/sys/access.2
| Show All 22 Lines | |||||
| .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
| .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
| .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
| .\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
| .\" | .\" | ||||
| .\" @(#)access.2 8.2 (Berkeley) 4/1/94 | .\" @(#)access.2 8.2 (Berkeley) 4/1/94 | ||||
| .\" $FreeBSD$ | .\" $FreeBSD$ | ||||
| .\" | .\" | ||||
| .Dd October 20, 2018 | .Dd November 11, 2018 | ||||
| .Dt ACCESS 2 | .Dt ACCESS 2 | ||||
| .Os | .Os | ||||
| .Sh NAME | .Sh NAME | ||||
| .Nm access , | .Nm access , | ||||
| .Nm eaccess , | .Nm eaccess , | ||||
| .Nm faccessat | .Nm faccessat | ||||
| .Nd check accessibility of a file | .Nd check accessibility of a file | ||||
| .Sh LIBRARY | .Sh LIBRARY | ||||
| ▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | |||||
| list, defined in | list, defined in | ||||
| .In fcntl.h : | .In fcntl.h : | ||||
| .Bl -tag -width indent | .Bl -tag -width indent | ||||
| .It Dv AT_EACCESS | .It Dv AT_EACCESS | ||||
| The checks for accessibility are performed using the effective user and group | The checks for accessibility are performed using the effective user and group | ||||
| IDs instead of the real user and group ID as required in a call to | IDs instead of the real user and group ID as required in a call to | ||||
| .Fn access . | .Fn access . | ||||
| .It Dv AT_BENEATH | .It Dv AT_BENEATH | ||||
| Only operate on files and directories below the starting directory. | Only operate on files and directories below the topping directory. | ||||
| See the description of the | |||||
| .Dv O_BENEATH | |||||
| flag in the | |||||
| .Xr open 2 | |||||
| manual page. | |||||
| .El | .El | ||||
| .Pp | .Pp | ||||
| Even if a process's real or effective user has appropriate privileges | Even if a process's real or effective user has appropriate privileges | ||||
| and indicates success for | and indicates success for | ||||
| .Dv X_OK , | .Dv X_OK , | ||||
| the file may not actually have execute permission bits set. | the file may not actually have execute permission bits set. | ||||
| Likewise for | Likewise for | ||||
| .Dv R_OK | .Dv R_OK | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
| The | The | ||||
| .Fa path | .Fa path | ||||
| argument is not an absolute path and | argument is not an absolute path and | ||||
| .Fa fd | .Fa fd | ||||
| is neither | is neither | ||||
| .Dv AT_FDCWD | .Dv AT_FDCWD | ||||
| nor a file descriptor associated with a directory. | nor a file descriptor associated with a directory. | ||||
| .It Bq Er ENOTCAPABLE | .It Bq Er ENOTCAPABLE | ||||
| .Fa path | |||||
| is an absolute path, | |||||
| or contained a ".." component leading to a | |||||
| directory outside of the directory hierarchy specified by | |||||
| .Fa fd , | |||||
| and the process is in capability mode. | |||||
| .It Bq Er ENOTCAPABLE | |||||
| The | The | ||||
| .Dv AT_BENEATH | .Dv AT_BENEATH | ||||
| flag was specified but | flag was provided to | ||||
| .Fn faccessat , | |||||
| and the absolute | |||||
| .Fa path | .Fa path | ||||
| is not strictly relative to the starting directory. | does not have its tail fully contained under the topping directory, | ||||
| For example, | or the relative | ||||
| .Fa path | .Fa path | ||||
| is absolute or includes a ".." component that escapes the starting directory. | escapes it. | ||||
| .El | .El | ||||
| .Sh SEE ALSO | .Sh SEE ALSO | ||||
| .Xr chmod 2 , | .Xr chmod 2 , | ||||
| .Xr intro 2 , | .Xr intro 2 , | ||||
| .Xr stat 2 | .Xr stat 2 | ||||
| .Sh STANDARDS | .Sh STANDARDS | ||||
| The | The | ||||
| .Fn access | .Fn access | ||||
| Show All 38 Lines | |||||