From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Cerri Subject: Re: [PATCH] auvirt: Remove workaround for VM name searching Date: Mon, 13 Feb 2012 09:46:10 -0200 Message-ID: <4F38F802.8010309@linux.vnet.ibm.com> References: <1328815120-6691-1-git-send-email-mhcerri@linux.vnet.ibm.com> <201202110947.57134.sgrubb@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.17]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1DBkIjo013005 for ; Mon, 13 Feb 2012 06:46:18 -0500 Received: from e24smtp01.br.ibm.com (e24smtp01.br.ibm.com [32.104.18.85]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1DBkGDX003073 for ; Mon, 13 Feb 2012 06:46:17 -0500 Received: from /spool/local by e24smtp01.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Feb 2012 09:46:15 -0200 In-Reply-To: <201202110947.57134.sgrubb@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Steve Grubb Cc: linux-audit@redhat.com, gcwilson@us.ibm.com, bryntcor@us.ibm.com List-Id: linux-audit@redhat.com On 02/11/2012 12:47 PM, Steve Grubb wrote: > On Thursday, February 09, 2012 02:18:40 PM Marcelo Cerri wrote: >> With this patch, the workaround for creating the search criteria is removed >> and escaped fields are properly retrieved. > > Applied, but one comment down below... > >> The unexpected single quote at the beginning of MAC addresses is fixed by a >> patch in libvirt: >> >> https://www.redhat.com/archives/libvir-list/2012-February/msg00502.html >> --- >> tools/auvirt/auvirt.c | 39 +++++++++++++++------------------------ >> 1 files changed, 15 insertions(+), 24 deletions(-) >> >> diff --git a/tools/auvirt/auvirt.c b/tools/auvirt/auvirt.c >> index c04780a..a89b097 100644 >> --- a/tools/auvirt/auvirt.c >> +++ b/tools/auvirt/auvirt.c >> @@ -781,7 +768,9 @@ int process_resource_event(auparse_state_t *au) >> } >> } else if (strcmp("cgroup", res_type) == 0) { >> auparse_first_record(au); >> - const char *cgroup = auparse_find_field(au, "cgroup"); >> + const char *cgroup = NULL; >> + if (auparse_find_field(au, "cgroup")) >> + cgroup = auparse_interpret_field(au); >> rc += add_resource(au, uuid, uid, time, name, success, reason, >> res_type, cgroup); > > > So, if cgroup is NULL here, does anything go boom later? No. It's safe because add_resource skips any invalid resource such as NULL, "", "0" or "?". > > -Steve >