[PATCH] errormsg: use descriptive macros for error numbers

Richard Guy Briggs rgb at redhat.com
Wed Apr 12 06:39:26 UTC 2017


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 <rgb at redhat.com>
> > ---
> >  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 <rgb at redhat.com>
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




More information about the Linux-audit mailing list