python/sepolgen: fix typo in PathChoooser name
PATCH 1/4 python/sepolgen: fix typo in PathChoooser name
Signed-off-by Nicolas Iooss <[email protected]>
--- python/sepolgen/src/sepolgen/defaults.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
python/sepolgen/src/sepolgen/defaults.py +3 -3
@@ -22,7 +22,7 @@ import re # Select the correct location for the development files based on a # path variable (optionally read from a configuration file) -class PathChoooser(object): +class PathChooser(object): def __init__(self, pathname): self.config = dict() if not os.path.exists(pathname):
@@ -68,10 +68,10 @@ def attribute_info(): return data_dir() + "/attribute_info" def refpolicy_makefile(): - chooser = PathChoooser("/etc/selinux/sepolgen.conf") + chooser = PathChooser("/etc/selinux/sepolgen.conf") return chooser("Makefile") def headers(): - chooser = PathChoooser("/etc/selinux/sepolgen.conf") + chooser = PathChooser("/etc/selinux/sepolgen.conf") return chooser("include")
Signature · 1 line
2.17.1
PATCH 2/4 policycoreutils/secon: fix typo in comment
Signed-off-by Nicolas Iooss <[email protected]>
--- policycoreutils/secon/secon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/secon/secon.c +1 -1
@@ -309,7 +309,7 @@ static void cmd_line(int argc, char *argv[]) } } -if (!done) {/* defualt, if nothing specified */ +if (!done) {/* default, if nothing specified */ opts->disp_user = TRUE; opts->disp_role = TRUE; opts->disp_type = TRUE;
Signature · 1 line
2.17.1
PATCH 3/4 policycoreutils/secon: free scon_trans before returning
In reply to Nicolas Ioossdisp_con() leaks scon_trans if it returns early.
Signed-off-by Nicolas Iooss <[email protected]>
--- policycoreutils/secon/secon.c | 1 + 1 file changed, 1 insertion(+)
policycoreutils/secon/secon.c +1 -0
@@ -646,6 +646,7 @@ static void disp_con(security_context_t scon_raw)disp__con_val ("clearance" ,NULL , &color);if (opts->disp_mlsr)disp__con_val ("mls-range" ,NULL , &color); +freecon (scon_trans);return ; }
Signature · 1 line
2.17.1
PATCH 4/4 policycoreutils/hll/pp: remove unused variable
In reply to Nicolas Ioosspp's main() never set outfd to anything else than -1 so there is no point in closing it.
Signed-off-by Nicolas Iooss <[email protected]>
--- policycoreutils/hll/pp/pp.c | 7 ------- 1 file changed, 7 deletions(-)
policycoreutils/hll/pp/pp.c +0 -7
@@ -73,7 +73,6 @@ int main(int argc, char **argv)const char *ofile =NULL ;FILE *in =NULL ;FILE *out =NULL ; -int outfd =-1 ;// ignore sigpipe so we can check the return code of write, and potentially // return a more helpful error message
@@ -159,12 +158,6 @@ exit:if (out !=NULL ) {fclose (out); } -if (outfd !=-1 ) { -close (outfd); -if (rc !=0 ) { -unlink (argv[2 ]); - } - }sepol_module_package_free (mod_pkg);return rc;
Signature · 1 line
2.17.1
Stephen Smalley
AppliedRe: [PATCH 4/4] policycoreutils/hll/pp: remove unused variable
Quoted 2 lines · Nicolas Iooss
pp's
main()never set outfd to anything else than -1 so there is no point in closing it.
Thanks, applied all four patches.
Quoted 32 lines
Signed-off-by Nicolas Iooss <[email protected]>--- policycoreutils/hll/pp/pp.c | 7 ------- 1 file changed, 7 deletions(-)policycoreutils/hll/pp/pp.c +0
-7@@ -73,7 +73,6 @@ int main(int argc, char **argv)const char *ofile =NULL ;FILE *in =NULL ;FILE *out =NULL ; -int outfd =-1 ;// ignore sigpipe so we can check the return code of write, and potentially // return a more helpful error message @@ -159,12 +158,6 @@ exit:if (out !=NULL ) {fclose (out); } -if (outfd !=-1 ) { -close (outfd); -if (rc !=0 ) { -unlink (argv[2 ]); - } - }sepol_module_package_free (mod_pkg);return rc;