From nobody Mon Feb 9 08:56:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1579780029; cv=none; d=zohomail.com; s=zohoarc; b=O0ZzuhqX0NxLuiDlPq26cU5pKERQXtVsqGPe1UsT5+Bv1ojI9tFq8vTHajO3jJXlYVzhsKIUAGenvpt+DQdqlcLcm+vKceAZiflaHDlyLUpF6B6erExSbDE73L30AC6m5jTyhIiBU8fkaOuKlwlyhnZUF5qs86eP2NQkKSopKxY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579780029; 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=DNYC1EiN7UmwpRwCF0UUBrJ6h0ivKxnMQi4hMPznzK0=; b=kTxjPi405r2PQ8RltIPFWBWXrwazwH1TfnKbtXhOeE1iKO1psByX60eiSp295ho/Fo/fbZOje7yAjtvAWYe+2+SaXBpi+PB+kg5ABZKepfeC4JdmA8PWkIAXKK8IvThM/xfp1WaLqKKaigQsipd3PIkGKzG8SA4eHN/TexednQ0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579780029497974.4362598628345; Thu, 23 Jan 2020 03:47:09 -0800 (PST) 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-260-1QMJ9dr5Nx6Ys_BiYoge2A-1; Thu, 23 Jan 2020 06:44:14 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7665ADB78; Thu, 23 Jan 2020 11:44:09 +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 4C4CE5C541; Thu, 23 Jan 2020 11:44:09 +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 F3F031803C43; Thu, 23 Jan 2020 11:44:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBi39h025494 for ; Thu, 23 Jan 2020 06:44:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4CD5685783; Thu, 23 Jan 2020 11:44:03 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC04A85780; Thu, 23 Jan 2020 11:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579780028; 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=DNYC1EiN7UmwpRwCF0UUBrJ6h0ivKxnMQi4hMPznzK0=; b=XH1qaBkF6sy2kcg8pzZylgjwv4mkxnhV28VB5InpIzhpcIuKtc9ekHYgS2fAPENPaDvMkT RJkNdI89e+t0IEbX9UjY9tJF1bstln/FwWeaHdQHrvKi1AAv5G45l4XrDNjxrX3HXJDsGR UCU13dkpsvjws/6hVZ9rmN2KDVTFlEU= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 21/32] src: conditionalize use of S_ISSOCK macro Date: Thu, 23 Jan 2020 11:43:14 +0000 Message-Id: <20200123114325.3860881-22-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.16 X-MC-Unique: 1QMJ9dr5Nx6Ys_BiYoge2A-1 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" The S_ISSOCK macro is not available on Windows platforms. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/libvirt-domain.c | 2 ++ src/security/security_manager.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 4074397b30..ceda85c243 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -10584,12 +10584,14 @@ virDomainOpenGraphics(virDomainPtr dom, goto error; } =20 +#ifndef WIN32 if (!S_ISSOCK(sb.st_mode)) { virReportInvalidArg(fd, _("fd %d must be a socket"), fd); goto error; } +#endif /* !WIN32 */ =20 virCheckReadOnlyGoto(dom->conn->flags, error); =20 diff --git a/src/security/security_manager.c b/src/security/security_manage= r.c index f229d94570..fe9def7fb9 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -1340,11 +1340,13 @@ virSecurityManagerMetadataLock(virSecurityManagerPt= r mgr G_GNUC_UNUSED, } =20 if ((fd =3D open(p, O_RDWR)) < 0) { +#ifndef WIN32 if (S_ISSOCK(sb.st_mode)) { /* Sockets can be opened only if there exists the * other side that listens. */ continue; } +#endif /* !WIN32 */ =20 virReportSystemError(errno, _("unable to open %s"), --=20 2.24.1