From 6fba030fedf047d3d8bed3c006506db59319249c Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 4 Jun 2021 10:24:46 +0200 Subject: [PATCH] virSecurityDACSetOwnershipInternal: Fix WIN32 code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I must admit, I have no idea why we build such POSIX dependent code as DAC driver for something such not POSIX as WIN32. Anyway, the code which is supposed to set error is not doing that. The proper way is to mimic what chown() does: On error, -1 is returned, and errno is set to indicate the error. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- src/security/security_dac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 603d5b98ef..7ba367755a 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -700,7 +700,8 @@ virSecurityDACSetOwnershipInternal(const virSecurityDACData *priv, } #ifdef WIN32 - rc = ENOSYS; + rc = -1; + errno = ENOSYS; #else /* !WIN32 */ rc = chown(path, uid, gid); #endif /* !WIN32 */