mirror of
https://git.kernel.org/pub/scm/libs/libcap/libcap.git
synced 2026-01-26 15:39:08 +00:00
Complete cap_launch fix.
Samanta Navarro included this in their suggested fix, but I missed including it in the previous commit. Fixed now. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
This commit is contained in:
parent
fd32fac5e3
commit
686084897c
@ -878,6 +878,7 @@ static int _cap_chroot(struct syscaller_s *sc, const char *root)
|
||||
__attribute__ ((noreturn))
|
||||
static void _cap_launch(int fd, cap_launch_t attr, void *detail) {
|
||||
struct syscaller_s *sc = &singlethread;
|
||||
int my_errno;
|
||||
|
||||
if (attr->custom_setup_fn && attr->custom_setup_fn(detail)) {
|
||||
goto defer;
|
||||
@ -919,8 +920,9 @@ defer:
|
||||
* getting here means an error has occurred and errno is
|
||||
* communicated to the parent
|
||||
*/
|
||||
my_errno = errno;
|
||||
for (;;) {
|
||||
int n = write(fd, &errno, sizeof(errno));
|
||||
int n = write(fd, &my_errno, sizeof(my_errno));
|
||||
if (n < 0 && errno == EAGAIN) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user