Skip to contentSkip to conversation

semodule-utils/semodule_package: report the output filename on write errors

PATCH In review Stephen Smalley 1 participant 2 messages Jul 16 – Jul 21 SELinux security module

lore
Share & tools
lore

Stephen Smalley

author maintainer
#0 lore raw

PATCH 1/1 semodule-utils/semodule_package: report the output filename on write errors

The error message reported argv[1] for the output filename, but this may be incorrect depending on option ordering. Use outfile instead.

---
 semodule-utils/semodule_package/semodule_package.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
semodule-utils/semodule_package/semodule_package.c +1 -1
index fa50a80a..c2bc49fd 100644
@@ -285,7 +285,7 @@ int main(int argc, char **argv)
 	if (sepol_module_package_write(pkg, out)) {
 		fprintf(stderr,
 			"%s:  Error while writing module package to %s\n",
-			argv[0], argv[1]);
+			argv[0], outfile);
 		goto failure;
 	}
 
Signature · 1 line
2.55.0
author maintainer
#1 lore raw
Quoted 5 lines · Stephen Smalley

The error message reported argv[1] for the output filename, but this may be incorrect depending on option ordering. Use outfile instead.

Merged.

Quoted 20 lines
---
 semodule-utils/semodule_package/semodule_package.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
semodule-utils/semodule_package/semodule_package.c +1 -2
index fa50a80a..c2bc49fd 100644
@@ -285,7 +285,7 @@ int main(int argc, char **argv)
        if (sepol_module_package_write(pkg, out)) {
                fprintf(stderr,
                        "%s:  Error while writing module package to %s\n",
-                       argv[0], argv[1]);
+                       argv[0], outfile);
                goto failure;
        }
 
--

2.55.0