From nobody Thu May 16 03:22:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1644586462; cv=none; d=zohomail.com; s=zohoarc; b=QALtIHzRL1EZe2K2iZPG+tyf1X65QMmbWidq29A/VHY7Nlu609ge2rePimGlAcvhRTR7HzEkzF/X2rLyNx1smuOVFqQE0ogwNMnfwhg8eeUvnZL2I3iF3ae2B33Xy2V/lsJ5tdhVPJ/+dmx2Wi6vpk3vOAWvv0P07Nq8sQdxWkc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644586462; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=7WWHiYp8/b6UGlP8uLNvA2J0i3YLhWebasln68kVvog=; b=ISuH2eqaiYb83/qyz9mEzjfhozbpmCUidpBuBhbLeJ3BBSvTvY3gYxQHez4jJ0oguS7brFHpJ09nHottoZJymAk2JckWSD0IX+WMU7gHgJLCSg7EOx8RYpzL3ZAieC3en+bsloBux1c6OId33JShSoZ9LM3szHNSNY1/qvoo7nE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1644586462724668.7592776750143; Fri, 11 Feb 2022 05:34:22 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-bVwARt5YN-2lB87SyyTyKg-1; Fri, 11 Feb 2022 08:34:19 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A043318B613D; Fri, 11 Feb 2022 13:34:13 +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 4D0C42B471; Fri, 11 Feb 2022 13:34:13 +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 8C7B41806D1C; Fri, 11 Feb 2022 13:34:12 +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 21BDYB5f015821 for ; Fri, 11 Feb 2022 08:34:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id DC7CE2B471; Fri, 11 Feb 2022 13:34:11 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.40.192.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0A8D2B4B9 for ; Fri, 11 Feb 2022 13:34:11 +0000 (UTC) Received: by rein.int.mamuti.net (Postfix, from userid 500) id 13DEB180154; Fri, 11 Feb 2022 14:34:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644586462; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7WWHiYp8/b6UGlP8uLNvA2J0i3YLhWebasln68kVvog=; b=JczTlitZjv80HHNFesJ0n3OT5Wy4HUOCnAMzy4UjuEMJACm+7/KoonLzCvbKQG6wkP853j zf17BMPvrjzBzsj88SAC/vnkl/mNmJusUHVD/Gg0T60YdfiU/9BZLR9/WnYxbqrK7mMC2Y WBjGWpVUVptst1CKdGlxi5b9T+IOMJE= X-MC-Unique: bVwARt5YN-2lB87SyyTyKg-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH] tests: Use freecon in testSELinuxCheckLabels Date: Fri, 11 Feb 2022 14:34:04 +0100 Message-Id: <6b6b91814e05dc290e1c0cf9e467fbaf492ae7e7.1644586444.git.jdenemar@redhat.com> 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.84 on 10.5.11.23 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) X-ZM-MESSAGEID: 1644586489735100001 Content-Type: text/plain; charset="utf-8" This partially reverts commit 0fc4a43d248b86fd54ad7323beb66faec8c1043c. Signed-off-by: Jiri Denemark --- tests/securityselinuxlabeltest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabelt= est.c index dfe9d38d34..83532d8090 100644 --- a/tests/securityselinuxlabeltest.c +++ b/tests/securityselinuxlabeltest.c @@ -230,7 +230,7 @@ testSELinuxCheckLabels(testSELinuxFile *files, size_t n= files) size_t i; =20 for (i =3D 0; i < nfiles; i++) { - g_autofree char *ctx =3D NULL; + char *ctx =3D NULL; if (getfilecon(files[i].file, &ctx) < 0) { if (errno =3D=3D ENODATA) { /* nothing to do */ @@ -247,8 +247,10 @@ testSELinuxCheckLabels(testSELinuxFile *files, size_t = nfiles) virReportError(VIR_ERR_INTERNAL_ERROR, "File %s context '%s' did not match expected '%= s'", files[i].file, ctx, files[i].context); + freecon(ctx); return -1; } + freecon(ctx); } return 0; } --=20 2.35.0