From nobody Mon Feb 9 00:30:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623926715; cv=none; d=zohomail.com; s=zohoarc; b=ZCOAJUktuW3H/2WbZ+PBbTgk7raaOeuvRY0v2UHLK7kYWAg9lZkXGcaQ5ah6FQDm7DQhS3dGe5Mq75tl2ji0mce4rQRWNdiVUhCA2durb9QI7Lwj5kXUakJot73zMbB7gUoalT3VyO0Kmxk+kF1MioaTAsanmq4gXqDP0HdAO68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623926715; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WxyYTrJzJc12t4adxzQ0XiWKZd320A7t1RpCOmActio=; b=j28yb/XhMCzzH4CzAxAia77y5YyrsN7HLUfGcytc1GWwhTbPO1F6MSuFEDZh7WC3/a78tW+2hoLcEbPUtDnSlBBpZEtnhpdlcc+jrK4oDPqdD9dlYx9tj75WzOU9diw/qzfBfD5BOpjKueomhED33jZjmCQPd3FhLv4C70nPLMg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623926715219246.5308805113408; Thu, 17 Jun 2021 03:45:15 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-468-d8GuVhS6PYmcec_-Wsamqg-1; Thu, 17 Jun 2021 06:45:10 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C5143801106; Thu, 17 Jun 2021 10:45:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA7885D6DC; Thu, 17 Jun 2021 10:45:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 749CC1809CAF; Thu, 17 Jun 2021 10:45:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15HAgJil018937 for ; Thu, 17 Jun 2021 06:42:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id ADDBD19D61; Thu, 17 Jun 2021 10:42:19 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3106119D9D for ; Thu, 17 Jun 2021 10:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623926714; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WxyYTrJzJc12t4adxzQ0XiWKZd320A7t1RpCOmActio=; b=I8awI4rlf9STrIpIBEgi+u2gBDOpczdpwTO0M6xANbhZuDFmjRTPYfE31Stk1ll7JIuK6y fxhZAdI0mSQ2dCOBBOZolaG6BXCgf/wv4gquZOI829Qbr1a3jd1LePb0NnDg7qhKR4mzmD 9dQxCSjR54oWZdWfEE+KnTuCXgRStVk= X-MC-Unique: d8GuVhS6PYmcec_-Wsamqg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 7/8] virSecurityDACSetOwnershipInternal: Fix WIN32 code Date: Thu, 17 Jun 2021 12:42:07 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 --- 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 virSecurityDAC= Data *priv, } =20 #ifdef WIN32 - rc =3D ENOSYS; + rc =3D -1; + errno =3D ENOSYS; #else /* !WIN32 */ rc =3D chown(path, uid, gid); #endif /* !WIN32 */ --=20 2.31.1