From nobody Sun Feb 8 16:30:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1620404716; cv=none; d=zohomail.com; s=zohoarc; b=gpnF5O92WvPYqV5R9pgXNF8uH9UwQctjzl1StLKpRN9cXe0wLrWCZuLnqwHZ+PDPglq9fF5erAOSAsuqsG14EyEjd6S2sh7M3EYiHNxfbpeUbTi7Dn+dpg6lWDfdtN2regEQPMYqTPIMaxDxz2PWgShgOdDUPB+Zxxden7Cxkbg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620404716; h=Content-Type:Content-Transfer-Encoding:Cc: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=2o5/Ga+HHVN/iMP9g76GwL+Pz9+zNRGlkIoJndvAdNA=; b=VuxpCNa9bDnnB8Kdqm4ledwtVn7wLLcvv7WZlHOhuT8yZrrWYrOH0eIxSFLT7d4g/v77e74ISyMx34ZTJe1KGs8Nf59ZjSsMwoOSbHTsvBs0wWUlYE7gsHhfhOJ+Fdw0kwimwWTro1SWOHwVmTTvepQI9z2DBP1WJ8CIBV+ERbo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1620404716704542.7757228318545; Fri, 7 May 2021 09:25:16 -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-601-XjJCOD72MlisoROHa8F-Og-1; Fri, 07 May 2021 12:25:12 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 708B31008060; Fri, 7 May 2021 16:25:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44F7D100164A; Fri, 7 May 2021 16:25:06 +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 CC0A155357; Fri, 7 May 2021 16:25:05 +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 147GOxB3003368 for ; Fri, 7 May 2021 12:24:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 13CD0189A5; Fri, 7 May 2021 16:24:59 +0000 (UTC) Received: from foo.redhat.com (ovpn-114-155.ams2.redhat.com [10.36.114.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CFB263B8C; Fri, 7 May 2021 16:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620404715; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=2o5/Ga+HHVN/iMP9g76GwL+Pz9+zNRGlkIoJndvAdNA=; b=JcuaIG7jn5iCwsHJMUMBmL8y/wKtcCl86YxXOzD6/GWRFCdqVkI7RBpyM5e01UFm9JJ9+z vBPCtlbTlt/5iFwdHuPhpSdhO5vFNfZ1lt71R7mPUgoBkZHtwqc8HyL+FSBJWyQSUUi9gG pLHn1ynrr2g8bKKH9msvJ354L+vNr5I= X-MC-Unique: XjJCOD72MlisoROHa8F-Og-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 04/10] util: set system token for system identity Date: Fri, 7 May 2021 17:24:42 +0100 Message-Id: <20210507162448.660074-5-berrange@redhat.com> In-Reply-To: <20210507162448.660074-1-berrange@redhat.com> References: <20210507162448.660074-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 Cc: Michal Privoznik 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.84 on 10.5.11.22 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Reviewed-by: Michal Privoznik Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/viridentity.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/viridentity.c b/src/util/viridentity.c index 8c939a507e..dabe416037 100644 --- a/src/util/viridentity.c +++ b/src/util/viridentity.c @@ -263,6 +263,7 @@ virIdentity *virIdentityGetSystem(void) #if WITH_SELINUX char *con; #endif + g_autofree char *token =3D NULL; =20 if (!(ret =3D virIdentityNew())) return NULL; @@ -305,6 +306,12 @@ virIdentity *virIdentityGetSystem(void) } #endif =20 + if (!(token =3D virIdentityEnsureSystemToken())) + return NULL; + + if (virIdentitySetSystemToken(ret, token) < 0) + return NULL; + return g_steal_pointer(&ret); } =20 --=20 2.31.1