public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Miloslav Trmac <mitr@redhat.com>
Cc: linux-audit <linux-audit@redhat.com>
Subject: Re: [patch RFC]: userspace crypto auditing, v2
Date: Sun, 05 Sep 2010 17:58:45 -0400	[thread overview]
Message-ID: <1283723925.2690.11.camel@localhost.localdomain> (raw)
In-Reply-To: <1429611619.681601283357248624.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>

On Wed, 2010-09-01 at 12:07 -0400, Miloslav Trmac wrote:
> Hello,
> I'm posting these patches for early review again; users of the code are not in the kernel yet.

I didn't really review them but I have just 2 style comments and one
thing you need to make sure of.  There are a couple of places the
indention starts to get way to the right.  I know there are places you
have things like

if (blah) {
	do blah
}
break;

and I'd typically rather see:

if (!blah)
	break;
do blah;
break;

A couple functions I think you can safely drop a level of indentation
include audit_log_crypto_op(), audit_filter_rules(), and maybe
log_crypto_op() needs a helper function to cut down the indentation?
Maybe not.

The other comment is that I disagree with the 80 column rule if and ONLY
if your code does not have too many levels of indention.  If you are
going to run just past 80 and only 2 or 3 levels of indentation go
ahead.  Do what looks best for the code.  I know Al likes 80 more than I
do, but doing stupid things just to meet 80 columns is foolish.

(This actually might be a topic at the upcoming kernel summit, so we
might have more hard and fast rules in the future, but for now, I
suggest trying to stick to 80, but if the code looks a lot better going
to 85 or maybe 90 or possibly even more, I say do it.

I really don't like %s in audit_log_format().  So unless its easy to
prove that the string meets all the rules and always will meet the
rules, please use audit_log_string()  (and in this code I noticed that I
could not verify 'operation' in this patch, which makes me very nervous.

I'll try to get some time to actually review the patch

-Eric

  reply	other threads:[~2010-09-05 21:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <940596721.681581283357233892.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
2010-09-01 16:07 ` [patch RFC]: userspace crypto auditing, v2 Miloslav Trmac
2010-09-05 21:58   ` Eric Paris [this message]
     [not found] <295377811.1108051283877911716.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
2010-09-07 16:45 ` Miloslav Trmac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283723925.2690.11.camel@localhost.localdomain \
    --to=eparis@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=mitr@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox