All of lore.kernel.org
 help / color / mirror / Atom feed
From: "José Pekkarinen" <jose.pekkarinen@unikie.com>
To: Arnout Vandecappelle <arnout@mind.be>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/audit: Fix type output on log folder creation
Date: Mon, 4 Oct 2021 08:56:49 +0300	[thread overview]
Message-ID: <CAJPV9Mpn1vDk5oGcZD2rxZRyJ7uYmcZpHm8xzyt=4HOeQtdH3Q@mail.gmail.com> (raw)
In-Reply-To: <07d1425c-7351-cc34-381c-a6fde26185fd@mind.be>


[-- Attachment #1.1: Type: text/plain, Size: 1947 bytes --]

On Sun, Oct 3, 2021 at 1:15 PM Arnout Vandecappelle <arnout@mind.be> wrote:

>
>
> On 01/10/2021 08:20, José Pekkarinen wrote:
> > Testing buildroot 2021.05 I observed that after first
> > boot I was having the following folders:
> >
> > /context:
> > /system_u:object_r:auditd_log_t
> >
> > The root of this problem turned to be a difference in the
> > output of $(selabel_lookup -b file -k /var/log/audit) called
> > by S02auditd that from this verison on looks like:
> >
> > $ selabel_lookup -b file -k /var/log/audit
> > Default context: system_u:object_r:auditd_log_t
>
>   What is the chance that this output format is going to change again?
> Does
> selabel_lookup has a "scriptable" output format that we can rely on not to
> change?
>

I'm afraid I have tried both all the options around

without any clearer output, for instance, -r(of raw) still
writes the 'Default context:' piece, as well as the -t(of type).
I know it doesn't look elegant, but for now it seems the
best we can afford.

Best regards.

José.



>
> >
> > This patch will cut it to retrieve the type piece only.
> >
> > Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> > ---
> >   package/audit/S02auditd | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/package/audit/S02auditd b/package/audit/S02auditd
> > index 0eef881cee..dd3dc22d6d 100644
> > --- a/package/audit/S02auditd
> > +++ b/package/audit/S02auditd
> > @@ -20,7 +20,7 @@ start(){
> >       # the directory with SELinux permissions if possible
> >       command -v selabel_lookup >/dev/null 2>&1
> >       if [ $? = 0 ]; then
> > -             mkdir -p /var/log/audit -Z `selabel_lookup -b file -k
> /var/log/audit`
> > +             mkdir -p /var/log/audit -Z `selabel_lookup -b file -k
> /var/log/audit | cut -d ' ' -f 3`
> >       else
> >               mkdir -p /var/log/audit
> >       fi
> >

[-- Attachment #1.2: Type: text/html, Size: 3096 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2021-10-04  5:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01  6:20 [Buildroot] [PATCH] package/audit: Fix type output on log folder creation José Pekkarinen
2021-10-03 10:15 ` Arnout Vandecappelle
2021-10-04  5:56   ` José Pekkarinen [this message]
2021-10-11 21:19     ` Arnout Vandecappelle
2021-10-18  8:20 ` Peter Korsgaard

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='CAJPV9Mpn1vDk5oGcZD2rxZRyJ7uYmcZpHm8xzyt=4HOeQtdH3Q@mail.gmail.com' \
    --to=jose.pekkarinen@unikie.com \
    --cc=arnout@mind.be \
    --cc=buildroot@buildroot.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.