Skip to contentSkip to conversation

Fix semodule option handling

PATCH Daniel J Walsh 2 participants 2 messages Oct 11, 2007 – Oct 12, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

semodule -B lksjdlj

will blow up.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHDoGGrlYvE4MpobMRAnWHAKCWIP/cHhbcwOjyc19RSqcvW2zAkACgscin BYK2/vMCU9tpuZH2RB3NrJ4=
=lkqh
-----END PGP SIGNATURE-----

semodule/semodule.c +4 -3
diff --exclude-from=exclude --exclude=sepolgen-1.0.10 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semodule/semodule.c policycoreutils-2.0.29/semodule/semodule.c
@@ -249,11 +249,12 @@
 		 * arguments as args. Will allow 'semodule -i *.pp' to
 		 * work as expected.
 		 */
-		if (commands[num_commands - 1].mode == INSTALL_M) {
+
+		if (commands && commands[num_commands - 1].mode == INSTALL_M) {
 			mode = INSTALL_M;
-		} else if (commands[num_commands - 1].mode == UPGRADE_M) {
+		} else if (commands && commands[num_commands - 1].mode == UPGRADE_M) {
 			mode = UPGRADE_M;
-		} else if (commands[num_commands - 1].mode == REMOVE_M) {
+		} else if (commands && commands[num_commands - 1].mode == REMOVE_M) {
 			mode = REMOVE_M;
 		} else {
 			fprintf(stderr, "unknown additional arguments:\n");
#1 lore raw
Quoted 6 lines · Daniel J Walsh

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

semodule -B lksjdlj

will blow up.

Looks reasonable (even though it isn't inline)

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.