libsemanage: Do not always print a module name warning
PATCH 1/1 libsemanage: Do not always print a module name warning
From: Miroslav Grep <[email protected]>
7a728e46 commit supposed to add a warning when a module name is different than a filename, but this warning is printed always. This commit fixes it.
Fixes:
$ semodule -X 400 -i testmod.pp Warning: SELinux userspace will refer to the module from testmod.pp as testmod rather than testmod
Signed-off-by Miroslav Grepl <[email protected]>
--- libsemanage/src/direct_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
libsemanage/src/direct_api.c +3 -1
@@ -1619,7 +1619,9 @@ static int semanage_direct_install_file(semanage_handle_t * sh,if ((retval =parse_module_headers (sh, data, data_len, &module_name, &version)) !=0 ) goto cleanup; -fprintf (stderr,"Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n" , install_filename, module_name, filename); +if (strcmp (module_name, filename) !=0 ) +fprintf (stderr,"Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n" , install_filename, module_name, filename); +free (version); } retval =semanage_direct_install (sh, data, data_len, module_name, lang_ext);
Signature · 1 line
1.8.3.1
PATCH 1/1 libsemanage: Do not always print a module name warning
From: Miroslav Grep <[email protected]>
7a728e46 commit supposed to add a warning when a module name is different than a filename, but this warning is printed always. This commit fixes it.
Fixes:
$ semodule -X 400 -i testmod.pp Warning: SELinux userspace will refer to the module from testmod.pp as testmod rather than testmod
Signed-off-by Miroslav Grepl <[email protected]>
--- libsemanage/src/direct_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
libsemanage/src/direct_api.c +3 -1
@@ -1619,7 +1619,9 @@ static int semanage_direct_install_file(semanage_handle_t * sh,if ((retval =parse_module_headers (sh, data, data_len, &module_name, &version)) !=0 ) goto cleanup; -fprintf (stderr,"Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n" , install_filename, module_name, filename); +if (strcmp (module_name, filename) !=0 ) +fprintf (stderr,"Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n" , install_filename, module_name, filename); +free (version); } retval =semanage_direct_install (sh, data, data_len, module_name, lang_ext);
Signature · 1 line
1.8.3.1
Stephen Smalley
AppliedQuoted 10 lines · Miroslav Grepl
From: Miroslav Grep <[email protected]>
7a728e46commit supposed to add a warning when a module name is different than a filename, but this warning is printed always. This commit fixes it.Fixes:
$ semodule -X 400 -i testmod.pp Warning: SELinux userspace will refer to the module from testmod.pp as testmod rather than testmod
Thanks, applied.
Quoted 22 lines
Signed-off-by Miroslav Grepl <[email protected]>--- libsemanage/src/direct_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)libsemanage/src/direct_api.c +3
-1@@ -1619,7 +1619,9 @@ static int semanage_direct_install_file(semanage_handle_t * sh,if ((retval =parse_module_headers (sh, data, data_len, &module_name, &version)) !=0 ) goto cleanup; -fprintf (stderr,"Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n" , install_filename, module_name, filename); +if (strcmp (module_name, filename) !=0 ) +fprintf (stderr,"Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n" , install_filename, module_name, filename); +free (version); } retval =semanage_direct_install (sh, data, data_len, module_name, lang_ext);