mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Paris <eparis@parisplace.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andy Shevchenko <ext-andriy.shevchenko@nokia.com>,
	aviro@redhat.com, Eric Paris <eparis@redhat.com>,
	Steve Grubb <sgrubb@redhat.com>,
	dwalsh@redhat.com
Subject: Re: [PATCH 02/12] audit: use kernel's method to get byte in hex form
Date: Mon, 22 Feb 2010 15:21:36 -0500	[thread overview]
Message-ID: <7e0fb38c1002221221xf8a2fb8ob3eb0098e8e75faf@mail.gmail.com> (raw)
In-Reply-To: <1266519351-3218-3-git-send-email-andy.shevchenko@gmail.com>

On Thu, Feb 18, 2010 at 1:55 PM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
>
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>


It changes the case from ABCDEF to abcdef but there are a number of
userspace tools which might not be able to handle it, have you tested
any or all of these?  The two that come to mind are ausearch and
setroubleshoot, which I believe both may try to recreate pathnames
when they contain a space....

-Eric


> ---
>  kernel/audit.c |    8 +++-----
>  1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/audit.c b/kernel/audit.c
> index 5feed23..160abad 100644
> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -58,6 +58,7 @@
>  #include <linux/inotify.h>
>  #include <linux/freezer.h>
>  #include <linux/tty.h>
> +#include <linux/kernel.h>
>
>  #include "audit.h"
>
> @@ -1308,7 +1309,6 @@ void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf,
>        int i, avail, new_len;
>        unsigned char *ptr;
>        struct sk_buff *skb;
> -       static const unsigned char *hex = "0123456789ABCDEF";
>
>        if (!ab)
>                return;
> @@ -1326,10 +1326,8 @@ void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf,
>        }
>
>        ptr = skb_tail_pointer(skb);
> -       for (i=0; i<len; i++) {
> -               *ptr++ = hex[(buf[i] & 0xF0)>>4]; /* Upper nibble */
> -               *ptr++ = hex[buf[i] & 0x0F];      /* Lower nibble */
> -       }
> +       for (i=0; i<len; i++)
> +               ptr = pack_hex_byte(ptr, buf[i]);
>        *ptr = 0;
>        skb_put(skb, len << 1); /* new string is twice the old string */
>  }
> --
> 1.5.6.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

  parent reply	other threads:[~2010-02-22 20:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-18 18:55 [PATCH 00/12] Clean up code to use native kernel functions when convert or check hex digits Andy Shevchenko
2010-02-18 18:55 ` [PATCH 01/12] isdn: remove ishexdigit() in regard to isxdigit() Andy Shevchenko
2010-02-18 18:55   ` [PATCH 02/12] audit: use kernel's method to get byte in hex form Andy Shevchenko
2010-02-18 18:55     ` [PATCH 03/12] staging: remove unused methods Andy Shevchenko
2010-02-18 18:55       ` [PATCH 04/12] scsi: ibmmca: use kernel native convertor Andy Shevchenko
2010-02-18 18:55         ` [PATCH 05/12] lib: introduce common method to convert hex digits Andy Shevchenko
2010-02-18 18:55           ` [PATCH 06/12] drivers: net: optimize hex2bin() Andy Shevchenko
2010-02-18 18:55             ` [PATCH 07/12] usb: atm: speedtch: use new hex_to_bin() method Andy Shevchenko
2010-02-18 18:55               ` [PATCH 08/12] net: " Andy Shevchenko
2010-02-18 18:55                 ` [PATCH 09/12] drivers: net: use kernel's method to get byte in hex form Andy Shevchenko
2010-02-18 18:55                   ` [PATCH 10/12] drivers: net: use new hex_to_bin() method Andy Shevchenko
2010-02-18 18:55                     ` [PATCH 11/12] drivers: isdn: " Andy Shevchenko
2010-02-18 18:55                       ` [PATCH 12/12] drivers: wireless: use kernel's method to get byte in hex form Andy Shevchenko
2010-02-18 23:55                       ` [PATCH 11/12] drivers: isdn: use new hex_to_bin() method Tilman Schmidt
2010-02-19  9:53                         ` [PATCHv2] " Andy Shevchenko
2010-02-19 14:53       ` [PATCH 03/12] staging: remove unused methods Greg KH
2010-02-22 20:21     ` Eric Paris [this message]
2010-02-22 21:18       ` [PATCH 02/12] audit: use kernel's method to get byte in hex form Andy Shevchenko
2010-02-18 23:36   ` [PATCH 01/12] isdn: remove ishexdigit() in regard to isxdigit() Tilman Schmidt
2010-02-19 11:41 ` [PATCH 00/12] Clean up code to use native kernel functions when convert or check hex digits Andy Shevchenko
2010-02-19 23:44   ` Tilman Schmidt

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=7e0fb38c1002221221xf8a2fb8ob3eb0098e8e75faf@mail.gmail.com \
    --to=eparis@parisplace.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=aviro@redhat.com \
    --cc=dwalsh@redhat.com \
    --cc=eparis@redhat.com \
    --cc=ext-andriy.shevchenko@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgrubb@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

all inboxes | Powered by JetHome®