* [Buildroot] [PATCH] package/audit: Fix type output on log folder creation
@ 2021-10-01 6:20 José Pekkarinen
2021-10-03 10:15 ` Arnout Vandecappelle
2021-10-18 8:20 ` Peter Korsgaard
0 siblings, 2 replies; 5+ messages in thread
From: José Pekkarinen @ 2021-10-01 6:20 UTC (permalink / raw)
To: buildroot; +Cc: José Pekkarinen
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
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
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH] package/audit: Fix type output on log folder creation
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
2021-10-18 8:20 ` Peter Korsgaard
1 sibling, 1 reply; 5+ messages in thread
From: Arnout Vandecappelle @ 2021-10-03 10:15 UTC (permalink / raw)
To: José Pekkarinen, buildroot
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?
Regards,
Arnout
>
> 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
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH] package/audit: Fix type output on log folder creation
2021-10-03 10:15 ` Arnout Vandecappelle
@ 2021-10-04 5:56 ` José Pekkarinen
2021-10-11 21:19 ` Arnout Vandecappelle
0 siblings, 1 reply; 5+ messages in thread
From: José Pekkarinen @ 2021-10-04 5:56 UTC (permalink / raw)
To: Arnout Vandecappelle; +Cc: buildroot
[-- 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH] package/audit: Fix type output on log folder creation
2021-10-04 5:56 ` José Pekkarinen
@ 2021-10-11 21:19 ` Arnout Vandecappelle
0 siblings, 0 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2021-10-11 21:19 UTC (permalink / raw)
To: José Pekkarinen; +Cc: buildroot
On 04/10/2021 07:56, José Pekkarinen wrote:
>
>
> On Sun, Oct 3, 2021 at 1:15 PM Arnout Vandecappelle <arnout@mind.be
> <mailto: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.
I've added a summary to the commit message and applied to master, thanks.
Regards,
Arnout
>
> Best regards.
>
> José.
>
>
> >
> > This patch will cut it to retrieve the type piece only.
> >
> > Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com
> <mailto: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
> >
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH] package/audit: Fix type output on log folder creation
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-18 8:20 ` Peter Korsgaard
1 sibling, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2021-10-18 8:20 UTC (permalink / raw)
To: José Pekkarinen; +Cc: buildroot
>>>>> "José" == José Pekkarinen <jose.pekkarinen@unikie.com> writes:
> 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
> This patch will cut it to retrieve the type piece only.
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
Committed to 2021.02.x and 2021.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-10-19 17:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-10-11 21:19 ` Arnout Vandecappelle
2021-10-18 8:20 ` Peter Korsgaard
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.