From 7da8e14c9d64da5a485f982d6f17b5eb4365b04f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 6 Sep 2018 21:39:18 -0400 Subject: [PATCH] Fix: non-zero return of open handled as error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/runas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/runas.c b/src/common/runas.c index 33462958f..c81652e9f 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -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; } -- 2.34.1