From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Cerri Subject: [PATCH 2/2] auvirt: Remove workaround for VM name searching Date: Wed, 8 Feb 2012 15:04:58 -0200 Message-ID: <1328720698-24633-2-git-send-email-mhcerri@linux.vnet.ibm.com> References: <1328720698-24633-1-git-send-email-mhcerri@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.19]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q18H5Lw1023245 for ; Wed, 8 Feb 2012 12:05:21 -0500 Received: from e24smtp03.br.ibm.com (e24smtp03.br.ibm.com [32.104.18.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q18H5JYg000678 for ; Wed, 8 Feb 2012 12:05:20 -0500 Received: from /spool/local by e24smtp03.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 8 Feb 2012 15:05:13 -0200 Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.8.31.93]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q18H6g341503482 for ; Wed, 8 Feb 2012 15:06:42 -0200 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q18H54dB027168 for ; Wed, 8 Feb 2012 15:05:04 -0200 In-Reply-To: <1328720698-24633-1-git-send-email-mhcerri@linux.vnet.ibm.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: linux-audit@redhat.com Cc: gcwilson@us.ibm.com, bryntcor@us.ibm.com List-Id: linux-audit@redhat.com Auvirt adds quotes to the given VM name when creating the search criteria. With the previous patch, this workaround is no longer needed and this patch removes it. --- tools/auvirt/auvirt.c | 19 +------------------ 1 files changed, 1 insertions(+), 18 deletions(-) diff --git a/tools/auvirt/auvirt.c b/tools/auvirt/auvirt.c index c04780a..11d6e97 100644 --- a/tools/auvirt/auvirt.c +++ b/tools/auvirt/auvirt.c @@ -312,24 +312,7 @@ int create_search_criteria(auparse_state_t *au) } } if (vm) { - /* - * If a field has its value quoted in the audit log, for - * example: - * vm="guest-name" - * - * auparse will consider the field value with quotes when - * matching a rule. For example, using the example above the - * following rule will not match: - * ausearch_add_item(au, "vm", "=", "guest-name", how); - * - * But this rule will match: - * ausearch_add_item(au, "vm", "=", "\"guest-name\"", how); - * - * TODO use a better approach for this problem... - */ - snprintf(expr, sizeof(expr), "\"%s\"", vm); - if (ausearch_add_item(au, "vm", "=", expr, - AUSEARCH_RULE_AND)) { + if (ausearch_add_item(au, "vm", "=", vm, AUSEARCH_RULE_AND)) { fprintf(stderr, "Criteria error: id\n"); return 1; } -- 1.7.1