Fix: non-zero return of open handled as error
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 Sep 2018 01:39:18 +0000 (21:39 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 Sep 2018 03:26:48 +0000 (23:26 -0400)
The open() run_as wrapper marks any non-zero return value
of open() as an error, causing the transmission of the file
descriptor to be skipped.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/runas.c

index 8daad8b28d2b36e31abb34667d1bc29fcd3e99f3..b4d35192ef157a7cd28593f0cca1321e483b9bb9 100644 (file)
@@ -218,7 +218,7 @@ int _open(struct run_as_data *data, struct run_as_ret *ret_value)
        ret_value->u.open.ret = open(data->u.open.path, data->u.open.flags, data->u.open.mode);
        ret_value->fd = ret_value->u.open.ret;
        ret_value->_errno = errno;
-       ret_value->_error = (ret_value->u.open.ret) ? true : false;
+       ret_value->_error = ret_value->u.open.ret < 0;
        return ret_value->u.open.ret;
 }
 
This page took 0.027657 seconds and 4 git commands to generate.