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 01:39:21 +0000 (21:39 -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 33462958f2e4b85b66976495b17873c2ce71ef1a..c81652e9f4b4f3a09ca1747c0b030aa9d1e13c42 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.034799 seconds and 4 git commands to generate.