selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libselinux: set an appropriate errno in booleans.c
@ 2019-01-31 19:48 Petr Lautrbach
  2019-01-31 19:48 ` [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage Petr Lautrbach
  2019-01-31 22:02 ` [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Nicolas Iooss
  0 siblings, 2 replies; 6+ messages in thread
From: Petr Lautrbach @ 2019-01-31 19:48 UTC (permalink / raw)
  To: selinux; +Cc: Petr Lautrbach

Fixes:
$ mkdir booleans
$ sudo mount --bind ./booleans /sys/fs/selinux/booleans
$ sudo getsebool -a
getsebool:  Unable to get boolean names:  Success

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

diff --git a/libselinux/src/booleans.c b/libselinux/src/booleans.c
index b3ea3623..a6d46fea 100644
--- a/libselinux/src/booleans.c
+++ b/libselinux/src/booleans.c
@@ -55,6 +55,7 @@ int security_get_boolean_names(char ***names, int *len)
 	snprintf(path, sizeof path, "%s%s", selinux_mnt, SELINUX_BOOL_DIR);
 	*len = scandir(path, &namelist, &filename_select, alphasort);
 	if (*len <= 0) {
+		errno = ENOENT;
 		return -1;
 	}
 
-- 
2.20.1


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

* [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage
  2019-01-31 19:48 [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Petr Lautrbach
@ 2019-01-31 19:48 ` Petr Lautrbach
  2019-01-31 22:02   ` Nicolas Iooss
  2019-01-31 22:02 ` [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Nicolas Iooss
  1 sibling, 1 reply; 6+ messages in thread
From: Petr Lautrbach @ 2019-01-31 19:48 UTC (permalink / raw)
  To: selinux; +Cc: Petr Lautrbach

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

diff --git a/libselinux/utils/matchpathcon.c b/libselinux/utils/matchpathcon.c
index 67e4a433..9756d7d9 100644
--- a/libselinux/utils/matchpathcon.c
+++ b/libselinux/utils/matchpathcon.c
@@ -14,7 +14,7 @@
 static __attribute__ ((__noreturn__)) void usage(const char *progname)
 {
 	fprintf(stderr,
-		"usage:  %s [-N] [-n] [-f file_contexts] [ -P policy_root_path ] [-p prefix] [-Vq] path...\n",
+		"usage:  %s [-V] [-N] [-n] [-m type] [-f file_contexts_file] [-p prefix] [-P policy_root_path] filepath...\n",
 		progname);
 	exit(1);
 }
-- 
2.20.1


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

* Re: [PATCH 1/2] libselinux: set an appropriate errno in booleans.c
  2019-01-31 19:48 [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Petr Lautrbach
  2019-01-31 19:48 ` [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage Petr Lautrbach
@ 2019-01-31 22:02 ` Nicolas Iooss
  2019-02-05  7:18   ` Nicolas Iooss
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Iooss @ 2019-01-31 22:02 UTC (permalink / raw)
  To: Petr Lautrbach; +Cc: selinux

On Thu, Jan 31, 2019 at 8:48 PM Petr Lautrbach <plautrba@redhat.com> wrote:
>
> Fixes:
> $ mkdir booleans
> $ sudo mount --bind ./booleans /sys/fs/selinux/booleans
> $ sudo getsebool -a
> getsebool:  Unable to get boolean names:  Success
>
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>

Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>
> ---
>  libselinux/src/booleans.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libselinux/src/booleans.c b/libselinux/src/booleans.c
> index b3ea3623..a6d46fea 100644
> --- a/libselinux/src/booleans.c
> +++ b/libselinux/src/booleans.c
> @@ -55,6 +55,7 @@ int security_get_boolean_names(char ***names, int *len)
>         snprintf(path, sizeof path, "%s%s", selinux_mnt, SELINUX_BOOL_DIR);
>         *len = scandir(path, &namelist, &filename_select, alphasort);
>         if (*len <= 0) {
> +               errno = ENOENT;
>                 return -1;
>         }
>
> --
> 2.20.1
>


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

* Re: [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage
  2019-01-31 19:48 ` [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage Petr Lautrbach
@ 2019-01-31 22:02   ` Nicolas Iooss
  2019-02-05  7:19     ` Nicolas Iooss
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Iooss @ 2019-01-31 22:02 UTC (permalink / raw)
  To: Petr Lautrbach; +Cc: selinux

On Thu, Jan 31, 2019 at 8:48 PM Petr Lautrbach <plautrba@redhat.com> wrote:
>
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>

Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>
> ---
>  libselinux/utils/matchpathcon.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libselinux/utils/matchpathcon.c b/libselinux/utils/matchpathcon.c
> index 67e4a433..9756d7d9 100644
> --- a/libselinux/utils/matchpathcon.c
> +++ b/libselinux/utils/matchpathcon.c
> @@ -14,7 +14,7 @@
>  static __attribute__ ((__noreturn__)) void usage(const char *progname)
>  {
>         fprintf(stderr,
> -               "usage:  %s [-N] [-n] [-f file_contexts] [ -P policy_root_path ] [-p prefix] [-Vq] path...\n",
> +               "usage:  %s [-V] [-N] [-n] [-m type] [-f file_contexts_file] [-p prefix] [-P policy_root_path] filepath...\n",
>                 progname);
>         exit(1);
>  }
> --
> 2.20.1
>


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

* Re: [PATCH 1/2] libselinux: set an appropriate errno in booleans.c
  2019-01-31 22:02 ` [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Nicolas Iooss
@ 2019-02-05  7:18   ` Nicolas Iooss
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Iooss @ 2019-02-05  7:18 UTC (permalink / raw)
  To: Petr Lautrbach; +Cc: selinux

On Thu, Jan 31, 2019 at 11:02 PM Nicolas Iooss <nicolas.iooss@m4x.org> wrote:
>
> On Thu, Jan 31, 2019 at 8:48 PM Petr Lautrbach <plautrba@redhat.com> wrote:
> >
> > Fixes:
> > $ mkdir booleans
> > $ sudo mount --bind ./booleans /sys/fs/selinux/booleans
> > $ sudo getsebool -a
> > getsebool:  Unable to get boolean names:  Success
> >
> > Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
>
> Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Merged. Thanks
Nicolas

> > ---
> >  libselinux/src/booleans.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/libselinux/src/booleans.c b/libselinux/src/booleans.c
> > index b3ea3623..a6d46fea 100644
> > --- a/libselinux/src/booleans.c
> > +++ b/libselinux/src/booleans.c
> > @@ -55,6 +55,7 @@ int security_get_boolean_names(char ***names, int *len)
> >         snprintf(path, sizeof path, "%s%s", selinux_mnt, SELINUX_BOOL_DIR);
> >         *len = scandir(path, &namelist, &filename_select, alphasort);
> >         if (*len <= 0) {
> > +               errno = ENOENT;
> >                 return -1;
> >         }
> >
> > --
> > 2.20.1
> >


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

* Re: [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage
  2019-01-31 22:02   ` Nicolas Iooss
@ 2019-02-05  7:19     ` Nicolas Iooss
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Iooss @ 2019-02-05  7:19 UTC (permalink / raw)
  To: Petr Lautrbach; +Cc: selinux

On Thu, Jan 31, 2019 at 11:02 PM Nicolas Iooss <nicolas.iooss@m4x.org> wrote:
>
> On Thu, Jan 31, 2019 at 8:48 PM Petr Lautrbach <plautrba@redhat.com> wrote:
> >
> > Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
>
> Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Merged. Thanks
Nicolas

> > ---
> >  libselinux/utils/matchpathcon.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libselinux/utils/matchpathcon.c b/libselinux/utils/matchpathcon.c
> > index 67e4a433..9756d7d9 100644
> > --- a/libselinux/utils/matchpathcon.c
> > +++ b/libselinux/utils/matchpathcon.c
> > @@ -14,7 +14,7 @@
> >  static __attribute__ ((__noreturn__)) void usage(const char *progname)
> >  {
> >         fprintf(stderr,
> > -               "usage:  %s [-N] [-n] [-f file_contexts] [ -P policy_root_path ] [-p prefix] [-Vq] path...\n",
> > +               "usage:  %s [-V] [-N] [-n] [-m type] [-f file_contexts_file] [-p prefix] [-P policy_root_path] filepath...\n",
> >                 progname);
> >         exit(1);
> >  }
> > --
> > 2.20.1
> >


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

end of thread, other threads:[~2019-02-05  7:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-31 19:48 [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Petr Lautrbach
2019-01-31 19:48 ` [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage Petr Lautrbach
2019-01-31 22:02   ` Nicolas Iooss
2019-02-05  7:19     ` Nicolas Iooss
2019-01-31 22:02 ` [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Nicolas Iooss
2019-02-05  7:18   ` Nicolas Iooss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).