From: Richard Guy Briggs Subject: Re: [PATCH] errormsg: use descriptive macros for error numbers Date: Wed, 12 Apr 2017 02:39:26 -0400 Message-ID: <20170412063926.GM18559@madcap2.tricolour.ca> References: <1491302212-521-1-git-send-email-rgb@redhat.com> <5183071.ISI9gAqKeZ@x2> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5183071.ISI9gAqKeZ@x2> 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, Peter Vrabec List-Id: linux-audit@redhat.com On 2017-04-11 17:33, Steve Grubb wrote: > On Tuesday, April 4, 2017 6:36:52 AM EDT Richard Guy Briggs wrote: > > Convert all the numerical error return codes in comparison option and field > > option parsing routines audit_rule_interfield_comp_data() and > > audit_rule_fieldpair_data() to descriptive macros for easier code navigation > > and verification. > > > > See: https://github.com/linux-audit/audit-userspace/issues/11 > > > > Signed-off-by: Richard Guy Briggs > > --- > > lib/errormsg.h | 29 +++++++++++++++++++ > > lib/libaudit.c | 84 > > ++++++++++++++++++++++++++++---------------------------- 2 files changed, > > 71 insertions(+), 42 deletions(-) > > Applied. Thanks for taking this patch. Are you able to adapt your workflow so that the original author of contributed patches shows up in the git commit author line with the original patch timestamp? Looking back through the repo history it appears you are the only author since you took over from mitr, which I know not to be true. As it is now, you appear to be the author of this patch and the patch date is a week later than it actually was. There is no way to the original author now. "git am" is able to do this. > But we still have hardcoded numbers in the err_msgtab[]. :-) Yes. Once all the return codes that use this function have been accounted for and have been converted to macros, we can throw the macros into an enum and not care what their actual value is and then convert the table. One step at a time! I wasn't able to see any of the duplication, overloading or message meanings drifting over time without this first step. Note: GitHub Milestones: I had arbitrarily picked the only listed milestone in github (which seemed reasonable at the time) to see how well that mechanism worked. Was that an appropriate milestone? Can we create some more and start using that facility for items in your TODO? > -Steve - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635