From nobody Sun Feb 8 16:30:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1564420432; cv=none; d=zoho.com; s=zohoarc; b=EcoQHtgpYCnO8Q2T16sqtgfPzUX6fxApgJB4+9M2s/0jrQIXrfXt/h+qqebXytrfEiETzTYetlTO3hDp25pDl/bgAX2NnfSAzfP5TLcwHkOCkAzSx8shXDrzun36sg0Xb4FRzgh+ybvvOhxVTlEs92TWOoTtxe5BH2joH1LmKBE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564420432; 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:ARC-Authentication-Results; bh=h9Zcz/QTTIguCn+Mz07d+q9Q1ltMFAMoAUMy6J3/pAk=; b=Qa/Fi1GwsACucYdc8E8CMIlyFaRZrnaQJqHfgKc5v9Z3+g+4CcCK1+kDjfBaPgMRARGePBzwlczBSRWLRceQ4fmbQYgGC/7ePnQtOXSL20yoF0uTAP8kwbPVgsCSx6hVhkYXbUheASld5qbnu4pX6oj9y48a0bLCYcc+1BLH4io= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156442043230655.763734559045815; Mon, 29 Jul 2019 10:13:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB16430C1E2A; Mon, 29 Jul 2019 17:13:50 +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 8B19F5D9E2; Mon, 29 Jul 2019 17:13:50 +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 4ACAB180BA99; Mon, 29 Jul 2019 17:13:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6THDnVc029078 for ; Mon, 29 Jul 2019 13:13:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 05D6E5C21F; Mon, 29 Jul 2019 17:13:49 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id 902245C206; Mon, 29 Jul 2019 17:13:37 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Mon, 29 Jul 2019 18:11:28 +0100 Message-Id: <20190729171130.25484-47-berrange@redhat.com> In-Reply-To: <20190729171130.25484-1-berrange@redhat.com> References: <20190729171130.25484-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH v3 46/48] util: storage identity attrs as virTypedParameter internally 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 29 Jul 2019 17:13:51 +0000 (UTC) We'll shortly be exposing the identity as virTypedParameter in the public header, so it simplifies life to use that as the internal representation too. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/libvirt_private.syms | 1 - src/util/viridentity.c | 385 ++++++++++++++++++--------------------- src/util/viridentity.h | 6 - tests/viridentitytest.c | 62 +------ 4 files changed, 180 insertions(+), 274 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index c7fb8c94e4..d42a939f5d 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2147,7 +2147,6 @@ virIdentityGetSASLUserName; virIdentityGetSELinuxContext; virIdentityGetSystem; virIdentityGetX509DName; -virIdentityIsEqual; virIdentityNew; virIdentitySetCurrent; virIdentitySetOSGroupID; diff --git a/src/util/viridentity.c b/src/util/viridentity.c index fe0c416bba..5324400650 100644 --- a/src/util/viridentity.c +++ b/src/util/viridentity.c @@ -41,24 +41,12 @@ =20 VIR_LOG_INIT("util.identity"); =20 -typedef enum { - VIR_IDENTITY_ATTR_OS_USER_NAME, - VIR_IDENTITY_ATTR_OS_USER_ID, - VIR_IDENTITY_ATTR_OS_GROUP_NAME, - VIR_IDENTITY_ATTR_OS_GROUP_ID, - VIR_IDENTITY_ATTR_OS_PROCESS_ID, - VIR_IDENTITY_ATTR_OS_PROCESS_TIME, - VIR_IDENTITY_ATTR_SASL_USER_NAME, - VIR_IDENTITY_ATTR_X509_DISTINGUISHED_NAME, - VIR_IDENTITY_ATTR_SELINUX_CONTEXT, - - VIR_IDENTITY_ATTR_LAST, -} virIdentityAttrType; - struct _virIdentity { virObject parent; =20 - char *attrs[VIR_IDENTITY_ATTR_LAST]; + int nparams; + int maxparams; + virTypedParameterPtr params; }; =20 static virClassPtr virIdentityClass; @@ -188,6 +176,7 @@ virIdentityPtr virIdentityGetSystem(void) _("Unable to lookup SELinux process conte= xt")); return ret; } + VIR_DEBUG("Set con %s", con); if (virIdentitySetSELinuxContext(ret, con) < 0) { freecon(con); goto error; @@ -229,131 +218,38 @@ virIdentityPtr virIdentityNew(void) static void virIdentityDispose(void *object) { virIdentityPtr ident =3D object; - size_t i; =20 - for (i =3D 0; i < VIR_IDENTITY_ATTR_LAST; i++) - VIR_FREE(ident->attrs[i]); -} - - -/** - * virIdentitySetAttr: - * @ident: the identity to modify - * @attr: the attribute type to set - * @value: the identifying value to associate with @attr - * - * Sets an identifying attribute @attr on @ident. Each - * @attr type can only be set once. - * - * Returns: 0 on success, or -1 on error - */ -static int -virIdentitySetAttr(virIdentityPtr ident, - unsigned int attr, - const char *value) -{ - int ret =3D -1; - VIR_DEBUG("ident=3D%p attribute=3D%u value=3D%s", ident, attr, value); - - if (ident->attrs[attr]) { - virReportError(VIR_ERR_OPERATION_DENIED, "%s", - _("Identity attribute is already set")); - goto cleanup; - } - - if (VIR_STRDUP(ident->attrs[attr], value) < 0) - goto cleanup; - - ret =3D 0; - - cleanup: - return ret; -} - - -/** - * virIdentityGetAttr: - * @ident: the identity to query - * @attr: the attribute to read - * @value: filled with the attribute value - * - * Fills @value with a pointer to the value associated - * with the identifying attribute @attr in @ident. If - * @attr is not set, then it will simply be initialized - * to NULL and considered as a successful read - * - * Returns 0 on success, -1 on error - */ -static int -virIdentityGetAttr(virIdentityPtr ident, - unsigned int attr, - const char **value) -{ - VIR_DEBUG("ident=3D%p attribute=3D%d value=3D%p", ident, attr, value); - - *value =3D ident->attrs[attr]; - - return 0; -} - - -/** - * virIdentityIsEqual: - * @identA: the first identity - * @identB: the second identity - * - * Compares every attribute in @identA and @identB - * to determine if they refer to the same identity - * - * Returns true if they are equal, false if not equal - */ -bool virIdentityIsEqual(virIdentityPtr identA, - virIdentityPtr identB) -{ - bool ret =3D false; - size_t i; - VIR_DEBUG("identA=3D%p identB=3D%p", identA, identB); - - for (i =3D 0; i < VIR_IDENTITY_ATTR_LAST; i++) { - if (STRNEQ_NULLABLE(identA->attrs[i], - identB->attrs[i])) - goto cleanup; - } - - ret =3D true; - cleanup: - return ret; + virTypedParamsFree(ident->params, ident->nparams); } =20 =20 int virIdentityGetOSUserName(virIdentityPtr ident, const char **username) { - return virIdentityGetAttr(ident, - VIR_IDENTITY_ATTR_OS_USER_NAME, - username); + return virTypedParamsGetString(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_USER_NAME, + username); } =20 =20 int virIdentityGetOSUserID(virIdentityPtr ident, uid_t *uid) { - int val; - const char *userid; + unsigned long long val; + int ret; =20 *uid =3D -1; - if (virIdentityGetAttr(ident, - VIR_IDENTITY_ATTR_OS_USER_ID, - &userid) < 0) - return -1; - - if (!userid) - return -1; =20 - if (virStrToLong_i(userid, NULL, 10, &val) < 0) + ret =3D virTypedParamsGetULLong(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_USER_ID, + &val); + if (ret < 0) return -1; =20 - *uid =3D (uid_t)val; + if (ret =3D=3D 1) + *uid =3D (uid_t)val; =20 return 0; } @@ -361,31 +257,32 @@ int virIdentityGetOSUserID(virIdentityPtr ident, int virIdentityGetOSGroupName(virIdentityPtr ident, const char **groupname) { - return virIdentityGetAttr(ident, - VIR_IDENTITY_ATTR_OS_GROUP_NAME, - groupname); + *groupname =3D NULL; + if (virTypedParamsGetString(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_GROUP_NAME, + groupname) < 0) + return -1; + return 0; } =20 =20 int virIdentityGetOSGroupID(virIdentityPtr ident, gid_t *gid) { - int val; - const char *groupid; + int ret; + unsigned long long val; =20 *gid =3D -1; - if (virIdentityGetAttr(ident, - VIR_IDENTITY_ATTR_OS_GROUP_ID, - &groupid) < 0) + ret =3D virTypedParamsGetULLong(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_GROUP_ID, + &val); + if (ret < 0) return -1; =20 - if (!groupid) - return -1; - - if (virStrToLong_i(groupid, NULL, 10, &val) < 0) - return -1; - - *gid =3D (gid_t)val; + if (ret =3D=3D 1) + *gid =3D (gid_t)val; =20 return 0; } @@ -394,22 +291,19 @@ int virIdentityGetOSGroupID(virIdentityPtr ident, int virIdentityGetOSProcessID(virIdentityPtr ident, pid_t *pid) { - unsigned long long val; - const char *processid; + int ret; + long long val; =20 *pid =3D 0; - if (virIdentityGetAttr(ident, - VIR_IDENTITY_ATTR_OS_PROCESS_ID, - &processid) < 0) - return -1; - - if (!processid) + ret =3D virTypedParamsGetLLong(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_PROCESS_ID, + &val); + if (ret < 0) return -1; =20 - if (virStrToLong_ull(processid, NULL, 10, &val) < 0) - return -1; - - *pid =3D (pid_t)val; + if (ret =3D=3D 1) + *pid =3D (gid_t)val; =20 return 0; } @@ -418,16 +312,11 @@ int virIdentityGetOSProcessID(virIdentityPtr ident, int virIdentityGetOSProcessTime(virIdentityPtr ident, unsigned long long *timestamp) { - const char *processtime; - if (virIdentityGetAttr(ident, - VIR_IDENTITY_ATTR_OS_PROCESS_TIME, - &processtime) < 0) - return -1; - - if (!processtime) - return -1; - - if (virStrToLong_ull(processtime, NULL, 10, timestamp) < 0) + *timestamp =3D 0; + if (virTypedParamsGetULLong(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_PROCESS_TIME, + timestamp) < 0) return -1; =20 return 0; @@ -437,101 +326,153 @@ int virIdentityGetOSProcessTime(virIdentityPtr iden= t, int virIdentityGetSASLUserName(virIdentityPtr ident, const char **username) { - return virIdentityGetAttr(ident, - VIR_IDENTITY_ATTR_SASL_USER_NAME, - username); + *username =3D NULL; + if (virTypedParamsGetString(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_SASL_USER_NAME, + username) < 0) + return -1; + return 0; } =20 =20 int virIdentityGetX509DName(virIdentityPtr ident, const char **dname) { - return virIdentityGetAttr(ident, - VIR_IDENTITY_ATTR_X509_DISTINGUISHED_NAME, - dname); + *dname =3D NULL; + if (virTypedParamsGetString(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_X509_DISTINGUISHED_NA= ME, + dname) < 0) + return -1; + return 0; } =20 =20 int virIdentityGetSELinuxContext(virIdentityPtr ident, const char **context) { - return virIdentityGetAttr(ident, - VIR_IDENTITY_ATTR_SELINUX_CONTEXT, - context); + *context =3D NULL; + if (virTypedParamsGetString(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_SELINUX_CONTEXT, + context) < 0) + return -1; + return 0; } =20 =20 int virIdentitySetOSUserName(virIdentityPtr ident, const char *username) { - return virIdentitySetAttr(ident, - VIR_IDENTITY_ATTR_OS_USER_NAME, - username); + if (virTypedParamsGet(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_USER_NAME)) { + virReportError(VIR_ERR_OPERATION_DENIED, "%s", + _("Identity attribute is already set")); + return -1; + } + + return virTypedParamsAddString(&ident->params, + &ident->nparams, + &ident->maxparams, + VIR_CONNECT_IDENTITY_OS_USER_NAME, + username); } =20 =20 int virIdentitySetOSUserID(virIdentityPtr ident, uid_t uid) { - VIR_AUTOFREE(char *) val =3D NULL; - - if (virAsprintf(&val, "%d", (int)uid) < 0) + if (virTypedParamsGet(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_USER_ID)) { + virReportError(VIR_ERR_OPERATION_DENIED, "%s", + _("Identity attribute is already set")); return -1; + } =20 - return virIdentitySetAttr(ident, - VIR_IDENTITY_ATTR_OS_USER_ID, - val); + return virTypedParamsAddULLong(&ident->params, + &ident->nparams, + &ident->maxparams, + VIR_CONNECT_IDENTITY_OS_USER_ID, + uid); } =20 =20 int virIdentitySetOSGroupName(virIdentityPtr ident, const char *groupname) { - return virIdentitySetAttr(ident, - VIR_IDENTITY_ATTR_OS_GROUP_NAME, - groupname); + if (virTypedParamsGet(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_GROUP_NAME)) { + virReportError(VIR_ERR_OPERATION_DENIED, "%s", + _("Identity attribute is already set")); + return -1; + } + + return virTypedParamsAddString(&ident->params, + &ident->nparams, + &ident->maxparams, + VIR_CONNECT_IDENTITY_OS_GROUP_NAME, + groupname); } =20 =20 int virIdentitySetOSGroupID(virIdentityPtr ident, gid_t gid) { - VIR_AUTOFREE(char *) val =3D NULL; - - if (virAsprintf(&val, "%d", (int)gid) < 0) + if (virTypedParamsGet(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_GROUP_ID)) { + virReportError(VIR_ERR_OPERATION_DENIED, "%s", + _("Identity attribute is already set")); return -1; + } =20 - return virIdentitySetAttr(ident, - VIR_IDENTITY_ATTR_OS_GROUP_ID, - val); + return virTypedParamsAddULLong(&ident->params, + &ident->nparams, + &ident->maxparams, + VIR_CONNECT_IDENTITY_OS_GROUP_ID, + gid); } =20 =20 int virIdentitySetOSProcessID(virIdentityPtr ident, pid_t pid) { - VIR_AUTOFREE(char *) val =3D NULL; - - if (virAsprintf(&val, "%lld", (long long) pid) < 0) + if (virTypedParamsGet(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_PROCESS_ID)) { + virReportError(VIR_ERR_OPERATION_DENIED, "%s", + _("Identity attribute is already set")); return -1; + } =20 - return virIdentitySetAttr(ident, - VIR_IDENTITY_ATTR_OS_PROCESS_ID, - val); + return virTypedParamsAddLLong(&ident->params, + &ident->nparams, + &ident->maxparams, + VIR_CONNECT_IDENTITY_OS_PROCESS_ID, + pid); } =20 =20 int virIdentitySetOSProcessTime(virIdentityPtr ident, unsigned long long timestamp) { - VIR_AUTOFREE(char *) val =3D NULL; - - if (virAsprintf(&val, "%llu", timestamp) < 0) + if (virTypedParamsGet(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_OS_PROCESS_TIME)) { + virReportError(VIR_ERR_OPERATION_DENIED, "%s", + _("Identity attribute is already set")); return -1; + } =20 - return virIdentitySetAttr(ident, - VIR_IDENTITY_ATTR_OS_PROCESS_TIME, - val); + return virTypedParamsAddULLong(&ident->params, + &ident->nparams, + &ident->maxparams, + VIR_CONNECT_IDENTITY_OS_PROCESS_TIME, + timestamp); } =20 =20 @@ -539,25 +480,55 @@ int virIdentitySetOSProcessTime(virIdentityPtr ident, int virIdentitySetSASLUserName(virIdentityPtr ident, const char *username) { - return virIdentitySetAttr(ident, - VIR_IDENTITY_ATTR_SASL_USER_NAME, - username); + if (virTypedParamsGet(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_SASL_USER_NAME)) { + virReportError(VIR_ERR_OPERATION_DENIED, "%s", + _("Identity attribute is already set")); + return -1; + } + + return virTypedParamsAddString(&ident->params, + &ident->nparams, + &ident->maxparams, + VIR_CONNECT_IDENTITY_SASL_USER_NAME, + username); } =20 =20 int virIdentitySetX509DName(virIdentityPtr ident, const char *dname) { - return virIdentitySetAttr(ident, - VIR_IDENTITY_ATTR_X509_DISTINGUISHED_NAME, - dname); + if (virTypedParamsGet(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_X509_DISTINGUISHED_NAME)) { + virReportError(VIR_ERR_OPERATION_DENIED, "%s", + _("Identity attribute is already set")); + return -1; + } + + return virTypedParamsAddString(&ident->params, + &ident->nparams, + &ident->maxparams, + VIR_CONNECT_IDENTITY_X509_DISTINGUISHED= _NAME, + dname); } =20 =20 int virIdentitySetSELinuxContext(virIdentityPtr ident, const char *context) { - return virIdentitySetAttr(ident, - VIR_IDENTITY_ATTR_SELINUX_CONTEXT, - context); + if (virTypedParamsGet(ident->params, + ident->nparams, + VIR_CONNECT_IDENTITY_SELINUX_CONTEXT)) { + virReportError(VIR_ERR_OPERATION_DENIED, "%s", + _("Identity attribute is already set")); + return -1; + } + + return virTypedParamsAddString(&ident->params, + &ident->nparams, + &ident->maxparams, + VIR_CONNECT_IDENTITY_SELINUX_CONTEXT, + context); } diff --git a/src/util/viridentity.h b/src/util/viridentity.h index 0925b740d9..6dc0393810 100644 --- a/src/util/viridentity.h +++ b/src/util/viridentity.h @@ -33,12 +33,6 @@ virIdentityPtr virIdentityGetSystem(void); =20 virIdentityPtr virIdentityNew(void); =20 - -bool virIdentityIsEqual(virIdentityPtr identA, - virIdentityPtr identB) - ATTRIBUTE_NONNULL(1) - ATTRIBUTE_NONNULL(2); - int virIdentityGetOSUserName(virIdentityPtr ident, const char **username); int virIdentityGetOSUserID(virIdentityPtr ident, diff --git a/tests/viridentitytest.c b/tests/viridentitytest.c index e57b68ec43..ba85c90d6c 100644 --- a/tests/viridentitytest.c +++ b/tests/viridentitytest.c @@ -85,63 +85,6 @@ static int testIdentityAttrs(const void *data ATTRIBUTE_= UNUSED) } =20 =20 -static int testIdentityEqual(const void *data ATTRIBUTE_UNUSED) -{ - int ret =3D -1; - virIdentityPtr identa =3D NULL; - virIdentityPtr identb =3D NULL; - - if (!(identa =3D virIdentityNew())) - goto cleanup; - if (!(identb =3D virIdentityNew())) - goto cleanup; - - if (!virIdentityIsEqual(identa, identb)) { - VIR_DEBUG("Empty identities were not equal"); - goto cleanup; - } - - if (virIdentitySetOSUserName(identa, "fred") < 0) - goto cleanup; - - if (virIdentityIsEqual(identa, identb)) { - VIR_DEBUG("Mis-matched identities should not be equal"); - goto cleanup; - } - - if (virIdentitySetOSUserName(identb, "fred") < 0) - goto cleanup; - - if (!virIdentityIsEqual(identa, identb)) { - VIR_DEBUG("Matched identities were not equal"); - goto cleanup; - } - - if (virIdentitySetOSGroupName(identa, "flintstone") < 0) - goto cleanup; - if (virIdentitySetOSGroupName(identb, "flintstone") < 0) - goto cleanup; - - if (!virIdentityIsEqual(identa, identb)) { - VIR_DEBUG("Matched identities were not equal"); - goto cleanup; - } - - if (virIdentitySetSASLUserName(identb, "fred@FLINTSTONE.COM") < 0) - goto cleanup; - - if (virIdentityIsEqual(identa, identb)) { - VIR_DEBUG("Mis-matched identities should not be equal"); - goto cleanup; - } - - ret =3D 0; - cleanup: - virObjectUnref(identa); - virObjectUnref(identb); - return ret; -} - static int testIdentityGetSystem(const void *data) { const char *context =3D data; @@ -166,7 +109,8 @@ static int testIdentityGetSystem(const void *data) goto cleanup; =20 if (STRNEQ_NULLABLE(val, context)) { - VIR_DEBUG("Unexpected SELinux context attribute"); + VIR_DEBUG("Unexpected SELinux context attribute '%s' !=3D '%s'", + val, context); goto cleanup; } =20 @@ -204,8 +148,6 @@ mymain(void) =20 if (virTestRun("Identity attributes ", testIdentityAttrs, NULL) < 0) ret =3D -1; - if (virTestRun("Identity equality ", testIdentityEqual, NULL) < 0) - ret =3D -1; if (virTestRun("Setting fake SELinux context ", testSetFakeSELinuxCont= ext, context) < 0) ret =3D -1; if (virTestRun("System identity (fake SELinux enabled) ", testIdentity= GetSystem, context) < 0) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list