mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Validate the mode argument in access, eaccess, and faccessat for optional
POSIX compliance and to improve compatibility with Linux and NetBSD The issue was identified with lib/libc/sys/t_access:access_inval from NetBSD Update the manpage accordingly PR: 181155 Reviewed by: jilles (code), jmmv (code), wblock (manpage), wollman (code) MFC after: 4 weeks Phabric: D678 (code), D786 (manpage) Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
f7efd14df1
commit
257597a434
2 changed files with 12 additions and 1 deletions
|
|
@ -133,8 +133,16 @@ and
|
|||
.Sh RETURN VALUES
|
||||
.Rv -std
|
||||
.Sh ERRORS
|
||||
Access to the file is denied if:
|
||||
.Fn access ,
|
||||
.Fn eaccess ,
|
||||
or
|
||||
.Fn faccessat
|
||||
will fail if:
|
||||
.Bl -tag -width Er
|
||||
.It Bq Er EINVAL
|
||||
The value of the
|
||||
.Fa mode
|
||||
argument is invalid.
|
||||
.It Bq Er ENOTDIR
|
||||
A component of the path prefix is not a directory.
|
||||
.It Bq Er ENAMETOOLONG
|
||||
|
|
|
|||
|
|
@ -2055,6 +2055,9 @@ kern_accessat(struct thread *td, int fd, char *path, enum uio_seg pathseg,
|
|||
cap_rights_t rights;
|
||||
int error;
|
||||
|
||||
if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0)
|
||||
return (EINVAL);
|
||||
|
||||
/*
|
||||
* Create and modify a temporary credential instead of one that
|
||||
* is potentially shared.
|
||||
|
|
|
|||
Loading…
Reference in a new issue