From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Grubb Subject: Re: [PATCH 2/2] Use a new funtion to instead of outing error message for field checking Date: Thu, 7 Aug 2008 13:45:15 -0400 Message-ID: <200808071345.15800.sgrubb@redhat.com> References: <489AD555.2080500@cn.fujitsu.com> <1218122846.5618.99.camel@amilo> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1218122846.5618.99.camel@amilo> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Miloslav =?utf-8?q?Trma=C4=8D?= Cc: Linux Audit List-Id: linux-audit@redhat.com On Thursday 07 August 2008 11:27:25 Miloslav Trma=C4=8D wrote: > > The method of outing error message for field checking is too big. It = is > > disadvantage to modify. Create a helper function to output error > > messages. > > It should be more pretty and smart. > > The whole part of libaudit that deals with audit rules seems to be only > usable by auditctl - after all, all the error codes added by recent > patches are not handled by any other application that might be using th= e > function. =C2=A0Are there any external applications that use > audit_rule_fieldpair_data(), for example? Not that I know of...but that doesn't mean that someone somewhere isn't=20 selling an app that does.=20 > Even if this patch is accepted (and it does improve the code),=20 I can't take a patch like this right now. It changes the API. I would how= ever=20 take a patch that just moves things in auditctl.c. Big API changes need t= o=20 wait for 1 or 2 more releases and then we can restructure things. > I think long-term it would be good not to enshrine the current error > reporting system - at minimum it should be very clearly documented > audit_number_to_errmsg() is not a long-term API and applications other > than auditctl should not use it. =C2=A0Or perhaps only move the code ou= t of > src/auditctl.c into src/errormsg.* and do not add it to libaudit at all= . I think that errors originating in libaudit should probably have text str= ing=20 in it that explains the errors. But we have to wait to change the API ano= ther=20 release or two. We also have to make sure that we don't introduce text=20 relocations as we add strings in libraries. Thanks, -Steve