libselinux: set an appropriate errno in booleans.c
PATCH 1/2 libselinux: set an appropriate errno in booleans.c
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 <[email protected]>
--- libselinux/src/booleans.c | 1 + 1 file changed, 1 insertion(+)
libselinux/src/booleans.c +1 -0
@@ -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 ; }
Signature · 1 line
2.20.1
PATCH 2/2 libselinux: Change matchpathcon usage to match with matchpathcon manpage
Signed-off-by Petr Lautrbach <[email protected]>
--- libselinux/utils/matchpathcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libselinux/utils/matchpathcon.c +1 -1
@@ -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 ); }
Signature · 1 line
2.20.1
Re: [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage
Quoted 2 lines · Petr Lautrbach
Signed-off-by Petr Lautrbach <[email protected]>
Acked-by Nicolas Iooss <[email protected]>
Quoted 20 lines
--- libselinux/utils/matchpathcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)libselinux/utils/matchpathcon.c +1
-2@@ -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
Re: [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage
Quoted 6 lines · Nicolas Iooss
Quoted 2 lines · Petr Lautrbach
Signed-off-by Petr Lautrbach <[email protected]>Acked-by Nicolas Iooss <[email protected]>
Merged. Thanks
Nicolas
Quoted 20 lines
Quoted 20 lines
--- libselinux/utils/matchpathcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)libselinux/utils/matchpathcon.c +1
-2@@ -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
Quoted 8 lines · Petr Lautrbach
Fixes:
$ mkdir booleans $ sudo mount --bind ./booleans /sys/fs/selinux/booleans $ sudo getsebool -a getsebool: Unable to get boolean names: SuccessSigned-off-by Petr Lautrbach <[email protected]>
Acked-by Nicolas Iooss <[email protected]>
Quoted 19 lines
--- libselinux/src/booleans.c | 1 + 1 file changed, 1 insertion(+)libselinux/src/booleans.c +1
-1@@ -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
Quoted 9 lines · Nicolas Iooss
Quoted 7 lines · Petr Lautrbach
Fixes:
$ mkdir booleans $ sudo mount --bind ./booleans /sys/fs/selinux/booleans $ sudo getsebool -a getsebool: Unable to get boolean names: Success
Quoted 3 lines
Quoted 1 line
Signed-off-by Petr Lautrbach <[email protected]>Acked-by Nicolas Iooss <[email protected]>
Merged. Thanks
Nicolas
Quoted 19 lines
Quoted 19 lines
--- libselinux/src/booleans.c | 1 + 1 file changed, 1 insertion(+)libselinux/src/booleans.c +1
-1@@ -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