mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-10 20:31:27 +01:00
posix_spawnattr_setflags(3): validate argument
Reviewed by: emaste, kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44195
This commit is contained in:
parent
2f5a315b30
commit
80ac36c3a2
@ -629,6 +629,10 @@ posix_spawnattr_getsigmask(const posix_spawnattr_t * __restrict sa,
|
||||
int
|
||||
posix_spawnattr_setflags(posix_spawnattr_t *sa, short flags)
|
||||
{
|
||||
if ((flags & ~(POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP |
|
||||
POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER |
|
||||
POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK)) != 0)
|
||||
return (EINVAL);
|
||||
(*sa)->sa_flags = flags;
|
||||
return (0);
|
||||
}
|
||||
|
@ -83,9 +83,12 @@ The default value of this attribute is as if no flags were set.
|
||||
.Sh RETURN VALUES
|
||||
The
|
||||
.Fn posix_spawnattr_getflags
|
||||
and
|
||||
function returns zero.
|
||||
The
|
||||
.Fn posix_spawnattr_setflags
|
||||
functions return zero.
|
||||
function returns zero on success, and
|
||||
.Er EINVAL
|
||||
on failure due to invalid flag specified.
|
||||
.Sh SEE ALSO
|
||||
.Xr posix_spawn 3 ,
|
||||
.Xr posix_spawnattr_destroy 3 ,
|
||||
|
Loading…
Reference in New Issue
Block a user