SELinux Archive on lore.kernel.org
 help / Atom feed
* [PATCH] libselinux/selinux_restorecon: Skip customized files also without -v
@ 2019-02-06 19:41 Petr Lautrbach
  2019-02-07 21:23 ` Nicolas Iooss
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Lautrbach @ 2019-02-06 19:41 UTC (permalink / raw)
  To: selinux; +Cc: Petr Lautrbach

In the original code, customizable file contexts were not changed only if -v was
used. It lead to different behavior when selinux_restorecon was run with -v and
without it.

Based on an initial patch by Jan Zarsky <jzarsky@redhat.com>

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 libselinux/src/selinux_restorecon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
index 42a48f5a..0f0fd6ca 100644
--- a/libselinux/src/selinux_restorecon.c
+++ b/libselinux/src/selinux_restorecon.c
@@ -672,8 +672,8 @@ static int restorecon_sb(const char *pathname, const struct stat *sb,
 				selinux_log(SELINUX_INFO,
 				 "%s not reset as customized by admin to %s\n",
 							    pathname, curcon);
-				goto out;
 			}
+			goto out;
 		}
 
 		if (!flags->set_specctx && curcon) {
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libselinux/selinux_restorecon: Skip customized files also without -v
  2019-02-06 19:41 [PATCH] libselinux/selinux_restorecon: Skip customized files also without -v Petr Lautrbach
@ 2019-02-07 21:23 ` Nicolas Iooss
  2019-02-10 16:50   ` Nicolas Iooss
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Iooss @ 2019-02-07 21:23 UTC (permalink / raw)
  To: Petr Lautrbach; +Cc: selinux

On Wed, Feb 6, 2019 at 8:41 PM Petr Lautrbach <plautrba@redhat.com> wrote:
>
> In the original code, customizable file contexts were not changed only if -v was
> used. It lead to different behavior when selinux_restorecon was run with -v and
> without it.
>
> Based on an initial patch by Jan Zarsky <jzarsky@redhat.com>
>
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>

Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>
> ---
>  libselinux/src/selinux_restorecon.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
> index 42a48f5a..0f0fd6ca 100644
> --- a/libselinux/src/selinux_restorecon.c
> +++ b/libselinux/src/selinux_restorecon.c
> @@ -672,8 +672,8 @@ static int restorecon_sb(const char *pathname, const struct stat *sb,
>                                 selinux_log(SELINUX_INFO,
>                                  "%s not reset as customized by admin to %s\n",
>                                                             pathname, curcon);
> -                               goto out;
>                         }
> +                       goto out;
>                 }
>
>                 if (!flags->set_specctx && curcon) {
> --
> 2.20.1
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libselinux/selinux_restorecon: Skip customized files also without -v
  2019-02-07 21:23 ` Nicolas Iooss
@ 2019-02-10 16:50   ` Nicolas Iooss
  0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Iooss @ 2019-02-10 16:50 UTC (permalink / raw)
  To: Petr Lautrbach; +Cc: selinux

On Thu, Feb 7, 2019 at 10:23 PM Nicolas Iooss <nicolas.iooss@m4x.org> wrote:
>
> On Wed, Feb 6, 2019 at 8:41 PM Petr Lautrbach <plautrba@redhat.com> wrote:
> >
> > In the original code, customizable file contexts were not changed only if -v was
> > used. It lead to different behavior when selinux_restorecon was run with -v and
> > without it.
> >
> > Based on an initial patch by Jan Zarsky <jzarsky@redhat.com>
> >
> > Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
>
> Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Merged.

Nicolas

> > ---
> >  libselinux/src/selinux_restorecon.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
> > index 42a48f5a..0f0fd6ca 100644
> > --- a/libselinux/src/selinux_restorecon.c
> > +++ b/libselinux/src/selinux_restorecon.c
> > @@ -672,8 +672,8 @@ static int restorecon_sb(const char *pathname, const struct stat *sb,
> >                                 selinux_log(SELINUX_INFO,
> >                                  "%s not reset as customized by admin to %s\n",
> >                                                             pathname, curcon);
> > -                               goto out;
> >                         }
> > +                       goto out;
> >                 }
> >
> >                 if (!flags->set_specctx && curcon) {
> > --
> > 2.20.1
> >


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06 19:41 [PATCH] libselinux/selinux_restorecon: Skip customized files also without -v Petr Lautrbach
2019-02-07 21:23 ` Nicolas Iooss
2019-02-10 16:50   ` Nicolas Iooss

SELinux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux/0 selinux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux selinux/ https://lore.kernel.org/selinux \
		selinux@vger.kernel.org selinux@archiver.kernel.org
	public-inbox-index selinux


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux


AGPL code for this site: git clone https://public-inbox.org/ public-inbox